diff options
author | Richard Purdie <richard@openedhand.com> | 2006-10-17 11:04:43 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-10-17 11:04:43 +0000 |
commit | 09f13534bdffe20734cb9d24171e7d04334ad24c (patch) | |
tree | 75d62cf9a1d5cfcd2a72602ec68dc90c61041699 | |
parent | b6959cf8d390ded754f9a4ab5ce746313663a510 (diff) | |
download | poky-09f13534bdffe20734cb9d24171e7d04334ad24c.tar.gz |
gtk+: remove outdated maemo version
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@804 311d38ba-8fff-0310-9ca6-ca027cbcb966
107 files changed, 0 insertions, 26139 deletions
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/000_gtk+-2.0.6-exportsymbols.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/000_gtk+-2.0.6-exportsymbols.patch deleted file mode 100644 index 736473696f..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/000_gtk+-2.0.6-exportsymbols.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | diff -ruN gtk+-2.0.6.orig/configure gtk+-2.0.6/configure | ||
2 | --- gtk+-2.0.6.orig/configure 2002-08-31 03:49:07.000000000 +0900 | ||
3 | +++ gtk+-2.0.6/configure 2002-08-31 03:52:45.000000000 +0900 | ||
4 | @@ -7904,7 +7904,8 @@ | ||
5 | if test "$os_win32" != yes; then | ||
6 | # libtool option to control which symbols are exported | ||
7 | # right now, symbols starting with _ are not exported | ||
8 | - LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[^_].*"' | ||
9 | + # Disabled until -export-symbols-regex works (RH patch) | ||
10 | + LIBTOOL_EXPORT_OPTIONS= | ||
11 | else | ||
12 | # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk) | ||
13 | LIBTOOL_EXPORT_OPTIONS= | ||
14 | diff -ruN gtk+-2.0.6.orig/configure.in gtk+-2.0.6/configure.in | ||
15 | --- gtk+-2.0.6.orig/configure.in 2002-08-31 03:49:07.000000000 +0900 | ||
16 | +++ gtk+-2.0.6/configure.in 2002-08-31 03:51:22.000000000 +0900 | ||
17 | @@ -273,7 +273,8 @@ | ||
18 | if test "$os_win32" != yes; then | ||
19 | # libtool option to control which symbols are exported | ||
20 | # right now, symbols starting with _ are not exported | ||
21 | - LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"' | ||
22 | + # Disabled until -export-symbols-regex works (RH patch) | ||
23 | + LIBTOOL_EXPORT_OPTIONS= | ||
24 | else | ||
25 | # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk) | ||
26 | LIBTOOL_EXPORT_OPTIONS= | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/000_gtk+-2.2.0-buildfix-immodule.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/000_gtk+-2.2.0-buildfix-immodule.patch deleted file mode 100644 index 5d80daf0bc..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/000_gtk+-2.2.0-buildfix-immodule.patch +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | diff -ruN gtk+-2.2.0.orig/modules/input/Makefile.am gtk+-2.2.0/modules/input/Makefile.am | ||
2 | --- gtk+-2.2.0.orig/modules/input/Makefile.am 2003-01-06 23:40:37.000000000 +0900 | ||
3 | +++ gtk+-2.2.0/modules/input/Makefile.am 2003-01-06 23:46:35.000000000 +0900 | ||
4 | @@ -118,7 +118,12 @@ | ||
5 | im-viqr.la | ||
6 | |||
7 | gtk.immodules: Makefile.am $(module_LTLIBRARIES) | ||
8 | - $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules | ||
9 | + @if $(RUN_QUERY_IMMODULES_TEST) ; then \ | ||
10 | + $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules ; \ | ||
11 | + else \ | ||
12 | + touch $@ ; \ | ||
13 | + fi | ||
14 | + | ||
15 | |||
16 | CLEANFILES = gtk.immodules | ||
17 | |||
18 | diff -ruN gtk+-2.2.0.orig/modules/input/Makefile.in gtk+-2.2.0/modules/input/Makefile.in | ||
19 | --- gtk+-2.2.0.orig/modules/input/Makefile.in 2003-01-06 23:39:08.000000000 +0900 | ||
20 | +++ gtk+-2.2.0/modules/input/Makefile.in 2003-01-06 23:46:44.000000000 +0900 | ||
21 | @@ -785,7 +785,11 @@ | ||
22 | rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules | ||
23 | |||
24 | gtk.immodules: Makefile.am $(module_LTLIBRARIES) | ||
25 | - $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules | ||
26 | + @if $(RUN_QUERY_IMMODULES_TEST) ; then \ | ||
27 | + $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules ; \ | ||
28 | + else \ | ||
29 | + touch $@ ; \ | ||
30 | + fi | ||
31 | |||
32 | @CROSS_COMPILING_FALSE@all-local: gtk.immodules | ||
33 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/002_xpmico.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/002_xpmico.patch deleted file mode 100644 index 21500db65a..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/002_xpmico.patch +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | diff -Nur gtk+-2.4.9.orig/gdk-pixbuf/io-ico.c gtk+-2.4.9/gdk-pixbuf/io-ico.c | ||
2 | --- gtk+-2.4.9.orig/gdk-pixbuf/io-ico.c 2004-08-25 18:52:18.000000000 +0200 | ||
3 | +++ gtk+-2.4.9/gdk-pixbuf/io-ico.c 2004-09-15 00:40:17.000000000 +0200 | ||
4 | @@ -210,6 +210,14 @@ | ||
5 | |||
6 | State->HeaderSize = 6 + IconCount*16; | ||
7 | |||
8 | + if (State->HeaderSize < 0) { | ||
9 | + g_set_error (error, | ||
10 | + GDK_PIXBUF_ERROR, | ||
11 | + GDK_PIXBUF_ERROR_CORRUPT_IMAGE, | ||
12 | + _("Invalid header in icon")); | ||
13 | + return; | ||
14 | + } | ||
15 | + | ||
16 | if (State->HeaderSize>State->BytesInHeaderBuf) { | ||
17 | guchar *tmp=g_try_realloc(State->HeaderBuf,State->HeaderSize); | ||
18 | if (!tmp) { | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/003_iconcache.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/003_iconcache.patch deleted file mode 100644 index e579c8e208..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/003_iconcache.patch +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --- gtk/updateiconcache.c.orig 2005-02-06 21:08:09.638762480 +0100 | ||
2 | +++ gtk+-2.6.2/gtk/updateiconcache.c 2005-02-06 21:15:13.639304600 +0100 | ||
3 | @@ -53,7 +53,7 @@ | ||
4 | gchar *cache_path; | ||
5 | int retval; | ||
6 | |||
7 | - retval = g_stat (path, &path_stat); | ||
8 | + retval = stat (path, &path_stat); | ||
9 | |||
10 | if (retval < 0) | ||
11 | { | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/automake-lossage.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/automake-lossage.patch deleted file mode 100644 index 0d423ddbb9..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/automake-lossage.patch +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | --- gtk+-2.4.1/docs/tutorial/Makefile.am~ 2003-05-06 22:54:20.000000000 +0100 | ||
2 | +++ gtk+-2.4.1/docs/tutorial/Makefile.am 2004-05-08 12:31:41.000000000 +0100 | ||
3 | @@ -52,21 +52,5 @@ | ||
4 | |||
5 | dist-hook: html | ||
6 | cp -Rp $(srcdir)/html $(distdir) | ||
7 | -else | ||
8 | -html: | ||
9 | - echo "***" | ||
10 | - echo "*** Warning: Tutorial not built" | ||
11 | - echo "***" | ||
12 | - | ||
13 | -pdf: | ||
14 | - echo "***" | ||
15 | - echo "*** Warning: Tutorial not built" | ||
16 | - echo "***" | ||
17 | - | ||
18 | -dist-hook: | ||
19 | - echo "***" | ||
20 | - echo "*** Warning: Tutorial not built" | ||
21 | - echo "*** DISTRIBUTION IS INCOMPLETE" | ||
22 | - echo "***" | ||
23 | endif | ||
24 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/configure.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/configure.diff deleted file mode 100644 index 77cda1ce27..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/configure.diff +++ /dev/null | |||
@@ -1,1885 +0,0 @@ | |||
1 | --- gtk+-2.6.4/configure 2005-03-30 15:05:06.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/configure 2005-03-30 15:07:58.000000000 +0300 | ||
3 | @@ -1057,6 +1057,7 @@ | ||
4 | --enable-xkb support XKB [default=maybe] | ||
5 | --disable-rebuilds disable all source autogeneration rules | ||
6 | --disable-visibility don't use ELF visibility attributes | ||
7 | + --disable-shortcuts disable keyboard shortcuts | ||
8 | --disable-shadowfb disable shadowfb support for linux-fb | ||
9 | --enable-fbmanager enable framebuffer manager support (GtkFB) | ||
10 | --enable-explicit-deps=[yes/no/auto] | ||
11 | @@ -1197,7 +1198,7 @@ | ||
12 | else | ||
13 | echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 | ||
14 | fi | ||
15 | - cd $ac_popdir | ||
16 | + cd "$ac_popdir" | ||
17 | done | ||
18 | fi | ||
19 | |||
20 | @@ -2663,8 +2664,7 @@ | ||
21 | cat conftest.err >&5 | ||
22 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
23 | (exit $ac_status); } && | ||
24 | - { ac_try='test -z "$ac_c_werror_flag" | ||
25 | - || test ! -s conftest.err' | ||
26 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
27 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
28 | (eval $ac_try) 2>&5 | ||
29 | ac_status=$? | ||
30 | @@ -2722,8 +2722,7 @@ | ||
31 | cat conftest.err >&5 | ||
32 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
33 | (exit $ac_status); } && | ||
34 | - { ac_try='test -z "$ac_c_werror_flag" | ||
35 | - || test ! -s conftest.err' | ||
36 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
37 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
38 | (eval $ac_try) 2>&5 | ||
39 | ac_status=$? | ||
40 | @@ -2839,8 +2838,7 @@ | ||
41 | cat conftest.err >&5 | ||
42 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
43 | (exit $ac_status); } && | ||
44 | - { ac_try='test -z "$ac_c_werror_flag" | ||
45 | - || test ! -s conftest.err' | ||
46 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
47 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
48 | (eval $ac_try) 2>&5 | ||
49 | ac_status=$? | ||
50 | @@ -2894,8 +2892,7 @@ | ||
51 | cat conftest.err >&5 | ||
52 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
53 | (exit $ac_status); } && | ||
54 | - { ac_try='test -z "$ac_c_werror_flag" | ||
55 | - || test ! -s conftest.err' | ||
56 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
57 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
58 | (eval $ac_try) 2>&5 | ||
59 | ac_status=$? | ||
60 | @@ -2940,8 +2937,7 @@ | ||
61 | cat conftest.err >&5 | ||
62 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
63 | (exit $ac_status); } && | ||
64 | - { ac_try='test -z "$ac_c_werror_flag" | ||
65 | - || test ! -s conftest.err' | ||
66 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
67 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
68 | (eval $ac_try) 2>&5 | ||
69 | ac_status=$? | ||
70 | @@ -2985,8 +2981,7 @@ | ||
71 | cat conftest.err >&5 | ||
72 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
73 | (exit $ac_status); } && | ||
74 | - { ac_try='test -z "$ac_c_werror_flag" | ||
75 | - || test ! -s conftest.err' | ||
76 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
77 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
78 | (eval $ac_try) 2>&5 | ||
79 | ac_status=$? | ||
80 | @@ -3759,7 +3754,7 @@ | ||
81 | ;; | ||
82 | *-*-irix6*) | ||
83 | # Find out which ABI we are using. | ||
84 | - echo '#line 3762 "configure"' > conftest.$ac_ext | ||
85 | + echo '#line 3757 "configure"' > conftest.$ac_ext | ||
86 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | ||
87 | (eval $ac_compile) 2>&5 | ||
88 | ac_status=$? | ||
89 | @@ -3879,8 +3874,7 @@ | ||
90 | cat conftest.err >&5 | ||
91 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
92 | (exit $ac_status); } && | ||
93 | - { ac_try='test -z "$ac_c_werror_flag" | ||
94 | - || test ! -s conftest.err' | ||
95 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
96 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
97 | (eval $ac_try) 2>&5 | ||
98 | ac_status=$? | ||
99 | @@ -4189,8 +4183,7 @@ | ||
100 | cat conftest.err >&5 | ||
101 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
102 | (exit $ac_status); } && | ||
103 | - { ac_try='test -z "$ac_c_werror_flag" | ||
104 | - || test ! -s conftest.err' | ||
105 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
106 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
107 | (eval $ac_try) 2>&5 | ||
108 | ac_status=$? | ||
109 | @@ -4360,8 +4353,7 @@ | ||
110 | cat conftest.err >&5 | ||
111 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
112 | (exit $ac_status); } && | ||
113 | - { ac_try='test -z "$ac_c_werror_flag" | ||
114 | - || test ! -s conftest.err' | ||
115 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
116 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
117 | (eval $ac_try) 2>&5 | ||
118 | ac_status=$? | ||
119 | @@ -4428,8 +4420,7 @@ | ||
120 | cat conftest.err >&5 | ||
121 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
122 | (exit $ac_status); } && | ||
123 | - { ac_try='test -z "$ac_c_werror_flag" | ||
124 | - || test ! -s conftest.err' | ||
125 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
126 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
127 | (eval $ac_try) 2>&5 | ||
128 | ac_status=$? | ||
129 | @@ -4689,8 +4680,7 @@ | ||
130 | cat conftest.err >&5 | ||
131 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
132 | (exit $ac_status); } && | ||
133 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
134 | - || test ! -s conftest.err' | ||
135 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
136 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
137 | (eval $ac_try) 2>&5 | ||
138 | ac_status=$? | ||
139 | @@ -4748,8 +4738,7 @@ | ||
140 | cat conftest.err >&5 | ||
141 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
142 | (exit $ac_status); } && | ||
143 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
144 | - || test ! -s conftest.err' | ||
145 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
146 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
147 | (eval $ac_try) 2>&5 | ||
148 | ac_status=$? | ||
149 | @@ -4820,8 +4809,7 @@ | ||
150 | cat conftest.err >&5 | ||
151 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
152 | (exit $ac_status); } && | ||
153 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
154 | - || test ! -s conftest.err' | ||
155 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
156 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
157 | (eval $ac_try) 2>&5 | ||
158 | ac_status=$? | ||
159 | @@ -4865,8 +4853,7 @@ | ||
160 | cat conftest.err >&5 | ||
161 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
162 | (exit $ac_status); } && | ||
163 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
164 | - || test ! -s conftest.err' | ||
165 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
166 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
167 | (eval $ac_try) 2>&5 | ||
168 | ac_status=$? | ||
169 | @@ -5331,7 +5318,7 @@ | ||
170 | |||
171 | |||
172 | # Provide some information about the compiler. | ||
173 | -echo "$as_me:5334:" \ | ||
174 | +echo "$as_me:5321:" \ | ||
175 | "checking for Fortran 77 compiler version" >&5 | ||
176 | ac_compiler=`set X $ac_compile; echo $2` | ||
177 | { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 | ||
178 | @@ -5377,8 +5364,7 @@ | ||
179 | cat conftest.err >&5 | ||
180 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
181 | (exit $ac_status); } && | ||
182 | - { ac_try='test -z "$ac_f77_werror_flag" | ||
183 | - || test ! -s conftest.err' | ||
184 | + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' | ||
185 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
186 | (eval $ac_try) 2>&5 | ||
187 | ac_status=$? | ||
188 | @@ -5427,8 +5413,7 @@ | ||
189 | cat conftest.err >&5 | ||
190 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
191 | (exit $ac_status); } && | ||
192 | - { ac_try='test -z "$ac_f77_werror_flag" | ||
193 | - || test ! -s conftest.err' | ||
194 | + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' | ||
195 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
196 | (eval $ac_try) 2>&5 | ||
197 | ac_status=$? | ||
198 | @@ -6388,11 +6373,11 @@ | ||
199 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
200 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
201 | -e 's:$: $lt_compiler_flag:'` | ||
202 | - (eval echo "\"\$as_me:6391: $lt_compile\"" >&5) | ||
203 | + (eval echo "\"\$as_me:6376: $lt_compile\"" >&5) | ||
204 | (eval "$lt_compile" 2>conftest.err) | ||
205 | ac_status=$? | ||
206 | cat conftest.err >&5 | ||
207 | - echo "$as_me:6395: \$? = $ac_status" >&5 | ||
208 | + echo "$as_me:6380: \$? = $ac_status" >&5 | ||
209 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
210 | # The compiler can only warn and ignore the option if not recognized | ||
211 | # So say no if there are warnings | ||
212 | @@ -6631,11 +6616,11 @@ | ||
213 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
214 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
215 | -e 's:$: $lt_compiler_flag:'` | ||
216 | - (eval echo "\"\$as_me:6634: $lt_compile\"" >&5) | ||
217 | + (eval echo "\"\$as_me:6619: $lt_compile\"" >&5) | ||
218 | (eval "$lt_compile" 2>conftest.err) | ||
219 | ac_status=$? | ||
220 | cat conftest.err >&5 | ||
221 | - echo "$as_me:6638: \$? = $ac_status" >&5 | ||
222 | + echo "$as_me:6623: \$? = $ac_status" >&5 | ||
223 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
224 | # The compiler can only warn and ignore the option if not recognized | ||
225 | # So say no if there are warnings | ||
226 | @@ -6691,11 +6676,11 @@ | ||
227 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
228 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
229 | -e 's:$: $lt_compiler_flag:'` | ||
230 | - (eval echo "\"\$as_me:6694: $lt_compile\"" >&5) | ||
231 | + (eval echo "\"\$as_me:6679: $lt_compile\"" >&5) | ||
232 | (eval "$lt_compile" 2>out/conftest.err) | ||
233 | ac_status=$? | ||
234 | cat out/conftest.err >&5 | ||
235 | - echo "$as_me:6698: \$? = $ac_status" >&5 | ||
236 | + echo "$as_me:6683: \$? = $ac_status" >&5 | ||
237 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||
238 | then | ||
239 | # The compiler can only warn and ignore the option if not recognized | ||
240 | @@ -7082,8 +7067,7 @@ | ||
241 | cat conftest.err >&5 | ||
242 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
243 | (exit $ac_status); } && | ||
244 | - { ac_try='test -z "$ac_c_werror_flag" | ||
245 | - || test ! -s conftest.err' | ||
246 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
247 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
248 | (eval $ac_try) 2>&5 | ||
249 | ac_status=$? | ||
250 | @@ -7143,8 +7127,7 @@ | ||
251 | cat conftest.err >&5 | ||
252 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
253 | (exit $ac_status); } && | ||
254 | - { ac_try='test -z "$ac_c_werror_flag" | ||
255 | - || test ! -s conftest.err' | ||
256 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
257 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
258 | (eval $ac_try) 2>&5 | ||
259 | ac_status=$? | ||
260 | @@ -8026,7 +8009,7 @@ | ||
261 | libsuff= | ||
262 | case "$host_cpu" in | ||
263 | x86_64*|s390x*|powerpc64*) | ||
264 | - echo '#line 8029 "configure"' > conftest.$ac_ext | ||
265 | + echo '#line 8012 "configure"' > conftest.$ac_ext | ||
266 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | ||
267 | (eval $ac_compile) 2>&5 | ||
268 | ac_status=$? | ||
269 | @@ -8357,8 +8340,7 @@ | ||
270 | cat conftest.err >&5 | ||
271 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
272 | (exit $ac_status); } && | ||
273 | - { ac_try='test -z "$ac_c_werror_flag" | ||
274 | - || test ! -s conftest.err' | ||
275 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
276 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
277 | (eval $ac_try) 2>&5 | ||
278 | ac_status=$? | ||
279 | @@ -8461,8 +8443,7 @@ | ||
280 | cat conftest.err >&5 | ||
281 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
282 | (exit $ac_status); } && | ||
283 | - { ac_try='test -z "$ac_c_werror_flag" | ||
284 | - || test ! -s conftest.err' | ||
285 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
286 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
287 | (eval $ac_try) 2>&5 | ||
288 | ac_status=$? | ||
289 | @@ -8527,8 +8508,7 @@ | ||
290 | cat conftest.err >&5 | ||
291 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
292 | (exit $ac_status); } && | ||
293 | - { ac_try='test -z "$ac_c_werror_flag" | ||
294 | - || test ! -s conftest.err' | ||
295 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
296 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
297 | (eval $ac_try) 2>&5 | ||
298 | ac_status=$? | ||
299 | @@ -8621,8 +8601,7 @@ | ||
300 | cat conftest.err >&5 | ||
301 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
302 | (exit $ac_status); } && | ||
303 | - { ac_try='test -z "$ac_c_werror_flag" | ||
304 | - || test ! -s conftest.err' | ||
305 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
306 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
307 | (eval $ac_try) 2>&5 | ||
308 | ac_status=$? | ||
309 | @@ -8687,8 +8666,7 @@ | ||
310 | cat conftest.err >&5 | ||
311 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
312 | (exit $ac_status); } && | ||
313 | - { ac_try='test -z "$ac_c_werror_flag" | ||
314 | - || test ! -s conftest.err' | ||
315 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
316 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
317 | (eval $ac_try) 2>&5 | ||
318 | ac_status=$? | ||
319 | @@ -8754,8 +8732,7 @@ | ||
320 | cat conftest.err >&5 | ||
321 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
322 | (exit $ac_status); } && | ||
323 | - { ac_try='test -z "$ac_c_werror_flag" | ||
324 | - || test ! -s conftest.err' | ||
325 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
326 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
327 | (eval $ac_try) 2>&5 | ||
328 | ac_status=$? | ||
329 | @@ -8821,8 +8798,7 @@ | ||
330 | cat conftest.err >&5 | ||
331 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
332 | (exit $ac_status); } && | ||
333 | - { ac_try='test -z "$ac_c_werror_flag" | ||
334 | - || test ! -s conftest.err' | ||
335 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
336 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
337 | (eval $ac_try) 2>&5 | ||
338 | ac_status=$? | ||
339 | @@ -8897,7 +8873,7 @@ | ||
340 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
341 | lt_status=$lt_dlunknown | ||
342 | cat > conftest.$ac_ext <<EOF | ||
343 | -#line 8900 "configure" | ||
344 | +#line 8876 "configure" | ||
345 | #include "confdefs.h" | ||
346 | |||
347 | #if HAVE_DLFCN_H | ||
348 | @@ -8995,7 +8971,7 @@ | ||
349 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
350 | lt_status=$lt_dlunknown | ||
351 | cat > conftest.$ac_ext <<EOF | ||
352 | -#line 8998 "configure" | ||
353 | +#line 8974 "configure" | ||
354 | #include "confdefs.h" | ||
355 | |||
356 | #if HAVE_DLFCN_H | ||
357 | @@ -10032,8 +10008,7 @@ | ||
358 | cat conftest.err >&5 | ||
359 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
360 | (exit $ac_status); } && | ||
361 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
362 | - || test ! -s conftest.err' | ||
363 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
364 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
365 | (eval $ac_try) 2>&5 | ||
366 | ac_status=$? | ||
367 | @@ -10094,8 +10069,7 @@ | ||
368 | cat conftest.err >&5 | ||
369 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
370 | (exit $ac_status); } && | ||
371 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
372 | - || test ! -s conftest.err' | ||
373 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
374 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
375 | (eval $ac_try) 2>&5 | ||
376 | ac_status=$? | ||
377 | @@ -11188,11 +11162,11 @@ | ||
378 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
379 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
380 | -e 's:$: $lt_compiler_flag:'` | ||
381 | - (eval echo "\"\$as_me:11191: $lt_compile\"" >&5) | ||
382 | + (eval echo "\"\$as_me:11165: $lt_compile\"" >&5) | ||
383 | (eval "$lt_compile" 2>conftest.err) | ||
384 | ac_status=$? | ||
385 | cat conftest.err >&5 | ||
386 | - echo "$as_me:11195: \$? = $ac_status" >&5 | ||
387 | + echo "$as_me:11169: \$? = $ac_status" >&5 | ||
388 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
389 | # The compiler can only warn and ignore the option if not recognized | ||
390 | # So say no if there are warnings | ||
391 | @@ -11248,11 +11222,11 @@ | ||
392 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
393 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
394 | -e 's:$: $lt_compiler_flag:'` | ||
395 | - (eval echo "\"\$as_me:11251: $lt_compile\"" >&5) | ||
396 | + (eval echo "\"\$as_me:11225: $lt_compile\"" >&5) | ||
397 | (eval "$lt_compile" 2>out/conftest.err) | ||
398 | ac_status=$? | ||
399 | cat out/conftest.err >&5 | ||
400 | - echo "$as_me:11255: \$? = $ac_status" >&5 | ||
401 | + echo "$as_me:11229: \$? = $ac_status" >&5 | ||
402 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||
403 | then | ||
404 | # The compiler can only warn and ignore the option if not recognized | ||
405 | @@ -11759,7 +11733,7 @@ | ||
406 | libsuff= | ||
407 | case "$host_cpu" in | ||
408 | x86_64*|s390x*|powerpc64*) | ||
409 | - echo '#line 11762 "configure"' > conftest.$ac_ext | ||
410 | + echo '#line 11736 "configure"' > conftest.$ac_ext | ||
411 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | ||
412 | (eval $ac_compile) 2>&5 | ||
413 | ac_status=$? | ||
414 | @@ -12090,8 +12064,7 @@ | ||
415 | cat conftest.err >&5 | ||
416 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
417 | (exit $ac_status); } && | ||
418 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
419 | - || test ! -s conftest.err' | ||
420 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
421 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
422 | (eval $ac_try) 2>&5 | ||
423 | ac_status=$? | ||
424 | @@ -12194,8 +12167,7 @@ | ||
425 | cat conftest.err >&5 | ||
426 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
427 | (exit $ac_status); } && | ||
428 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
429 | - || test ! -s conftest.err' | ||
430 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
431 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
432 | (eval $ac_try) 2>&5 | ||
433 | ac_status=$? | ||
434 | @@ -12260,8 +12232,7 @@ | ||
435 | cat conftest.err >&5 | ||
436 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
437 | (exit $ac_status); } && | ||
438 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
439 | - || test ! -s conftest.err' | ||
440 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
441 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
442 | (eval $ac_try) 2>&5 | ||
443 | ac_status=$? | ||
444 | @@ -12354,8 +12325,7 @@ | ||
445 | cat conftest.err >&5 | ||
446 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
447 | (exit $ac_status); } && | ||
448 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
449 | - || test ! -s conftest.err' | ||
450 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
451 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
452 | (eval $ac_try) 2>&5 | ||
453 | ac_status=$? | ||
454 | @@ -12420,8 +12390,7 @@ | ||
455 | cat conftest.err >&5 | ||
456 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
457 | (exit $ac_status); } && | ||
458 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
459 | - || test ! -s conftest.err' | ||
460 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
461 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
462 | (eval $ac_try) 2>&5 | ||
463 | ac_status=$? | ||
464 | @@ -12487,8 +12456,7 @@ | ||
465 | cat conftest.err >&5 | ||
466 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
467 | (exit $ac_status); } && | ||
468 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
469 | - || test ! -s conftest.err' | ||
470 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
471 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
472 | (eval $ac_try) 2>&5 | ||
473 | ac_status=$? | ||
474 | @@ -12554,8 +12522,7 @@ | ||
475 | cat conftest.err >&5 | ||
476 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
477 | (exit $ac_status); } && | ||
478 | - { ac_try='test -z "$ac_cxx_werror_flag" | ||
479 | - || test ! -s conftest.err' | ||
480 | + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' | ||
481 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
482 | (eval $ac_try) 2>&5 | ||
483 | ac_status=$? | ||
484 | @@ -12630,7 +12597,7 @@ | ||
485 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
486 | lt_status=$lt_dlunknown | ||
487 | cat > conftest.$ac_ext <<EOF | ||
488 | -#line 12633 "configure" | ||
489 | +#line 12600 "configure" | ||
490 | #include "confdefs.h" | ||
491 | |||
492 | #if HAVE_DLFCN_H | ||
493 | @@ -12728,7 +12695,7 @@ | ||
494 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
495 | lt_status=$lt_dlunknown | ||
496 | cat > conftest.$ac_ext <<EOF | ||
497 | -#line 12731 "configure" | ||
498 | +#line 12698 "configure" | ||
499 | #include "confdefs.h" | ||
500 | |||
501 | #if HAVE_DLFCN_H | ||
502 | @@ -13565,11 +13532,11 @@ | ||
503 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
504 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
505 | -e 's:$: $lt_compiler_flag:'` | ||
506 | - (eval echo "\"\$as_me:13568: $lt_compile\"" >&5) | ||
507 | + (eval echo "\"\$as_me:13535: $lt_compile\"" >&5) | ||
508 | (eval "$lt_compile" 2>conftest.err) | ||
509 | ac_status=$? | ||
510 | cat conftest.err >&5 | ||
511 | - echo "$as_me:13572: \$? = $ac_status" >&5 | ||
512 | + echo "$as_me:13539: \$? = $ac_status" >&5 | ||
513 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
514 | # The compiler can only warn and ignore the option if not recognized | ||
515 | # So say no if there are warnings | ||
516 | @@ -13625,11 +13592,11 @@ | ||
517 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
518 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
519 | -e 's:$: $lt_compiler_flag:'` | ||
520 | - (eval echo "\"\$as_me:13628: $lt_compile\"" >&5) | ||
521 | + (eval echo "\"\$as_me:13595: $lt_compile\"" >&5) | ||
522 | (eval "$lt_compile" 2>out/conftest.err) | ||
523 | ac_status=$? | ||
524 | cat out/conftest.err >&5 | ||
525 | - echo "$as_me:13632: \$? = $ac_status" >&5 | ||
526 | + echo "$as_me:13599: \$? = $ac_status" >&5 | ||
527 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||
528 | then | ||
529 | # The compiler can only warn and ignore the option if not recognized | ||
530 | @@ -14006,8 +13973,7 @@ | ||
531 | cat conftest.err >&5 | ||
532 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
533 | (exit $ac_status); } && | ||
534 | - { ac_try='test -z "$ac_f77_werror_flag" | ||
535 | - || test ! -s conftest.err' | ||
536 | + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' | ||
537 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
538 | (eval $ac_try) 2>&5 | ||
539 | ac_status=$? | ||
540 | @@ -14057,8 +14023,7 @@ | ||
541 | cat conftest.err >&5 | ||
542 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
543 | (exit $ac_status); } && | ||
544 | - { ac_try='test -z "$ac_f77_werror_flag" | ||
545 | - || test ! -s conftest.err' | ||
546 | + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' | ||
547 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
548 | (eval $ac_try) 2>&5 | ||
549 | ac_status=$? | ||
550 | @@ -14940,7 +14905,7 @@ | ||
551 | libsuff= | ||
552 | case "$host_cpu" in | ||
553 | x86_64*|s390x*|powerpc64*) | ||
554 | - echo '#line 14943 "configure"' > conftest.$ac_ext | ||
555 | + echo '#line 14908 "configure"' > conftest.$ac_ext | ||
556 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | ||
557 | (eval $ac_compile) 2>&5 | ||
558 | ac_status=$? | ||
559 | @@ -15681,11 +15646,11 @@ | ||
560 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
561 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
562 | -e 's:$: $lt_compiler_flag:'` | ||
563 | - (eval echo "\"\$as_me:15684: $lt_compile\"" >&5) | ||
564 | + (eval echo "\"\$as_me:15649: $lt_compile\"" >&5) | ||
565 | (eval "$lt_compile" 2>conftest.err) | ||
566 | ac_status=$? | ||
567 | cat conftest.err >&5 | ||
568 | - echo "$as_me:15688: \$? = $ac_status" >&5 | ||
569 | + echo "$as_me:15653: \$? = $ac_status" >&5 | ||
570 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
571 | # The compiler can only warn and ignore the option if not recognized | ||
572 | # So say no if there are warnings | ||
573 | @@ -15924,11 +15889,11 @@ | ||
574 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
575 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
576 | -e 's:$: $lt_compiler_flag:'` | ||
577 | - (eval echo "\"\$as_me:15927: $lt_compile\"" >&5) | ||
578 | + (eval echo "\"\$as_me:15892: $lt_compile\"" >&5) | ||
579 | (eval "$lt_compile" 2>conftest.err) | ||
580 | ac_status=$? | ||
581 | cat conftest.err >&5 | ||
582 | - echo "$as_me:15931: \$? = $ac_status" >&5 | ||
583 | + echo "$as_me:15896: \$? = $ac_status" >&5 | ||
584 | if (exit $ac_status) && test -s "$ac_outfile"; then | ||
585 | # The compiler can only warn and ignore the option if not recognized | ||
586 | # So say no if there are warnings | ||
587 | @@ -15984,11 +15949,11 @@ | ||
588 | -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ | ||
589 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||
590 | -e 's:$: $lt_compiler_flag:'` | ||
591 | - (eval echo "\"\$as_me:15987: $lt_compile\"" >&5) | ||
592 | + (eval echo "\"\$as_me:15952: $lt_compile\"" >&5) | ||
593 | (eval "$lt_compile" 2>out/conftest.err) | ||
594 | ac_status=$? | ||
595 | cat out/conftest.err >&5 | ||
596 | - echo "$as_me:15991: \$? = $ac_status" >&5 | ||
597 | + echo "$as_me:15956: \$? = $ac_status" >&5 | ||
598 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||
599 | then | ||
600 | # The compiler can only warn and ignore the option if not recognized | ||
601 | @@ -16375,8 +16340,7 @@ | ||
602 | cat conftest.err >&5 | ||
603 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
604 | (exit $ac_status); } && | ||
605 | - { ac_try='test -z "$ac_c_werror_flag" | ||
606 | - || test ! -s conftest.err' | ||
607 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
608 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
609 | (eval $ac_try) 2>&5 | ||
610 | ac_status=$? | ||
611 | @@ -16436,8 +16400,7 @@ | ||
612 | cat conftest.err >&5 | ||
613 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
614 | (exit $ac_status); } && | ||
615 | - { ac_try='test -z "$ac_c_werror_flag" | ||
616 | - || test ! -s conftest.err' | ||
617 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
618 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
619 | (eval $ac_try) 2>&5 | ||
620 | ac_status=$? | ||
621 | @@ -17319,7 +17282,7 @@ | ||
622 | libsuff= | ||
623 | case "$host_cpu" in | ||
624 | x86_64*|s390x*|powerpc64*) | ||
625 | - echo '#line 17322 "configure"' > conftest.$ac_ext | ||
626 | + echo '#line 17285 "configure"' > conftest.$ac_ext | ||
627 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | ||
628 | (eval $ac_compile) 2>&5 | ||
629 | ac_status=$? | ||
630 | @@ -17650,8 +17613,7 @@ | ||
631 | cat conftest.err >&5 | ||
632 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
633 | (exit $ac_status); } && | ||
634 | - { ac_try='test -z "$ac_c_werror_flag" | ||
635 | - || test ! -s conftest.err' | ||
636 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
637 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
638 | (eval $ac_try) 2>&5 | ||
639 | ac_status=$? | ||
640 | @@ -17754,8 +17716,7 @@ | ||
641 | cat conftest.err >&5 | ||
642 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
643 | (exit $ac_status); } && | ||
644 | - { ac_try='test -z "$ac_c_werror_flag" | ||
645 | - || test ! -s conftest.err' | ||
646 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
647 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
648 | (eval $ac_try) 2>&5 | ||
649 | ac_status=$? | ||
650 | @@ -17820,8 +17781,7 @@ | ||
651 | cat conftest.err >&5 | ||
652 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
653 | (exit $ac_status); } && | ||
654 | - { ac_try='test -z "$ac_c_werror_flag" | ||
655 | - || test ! -s conftest.err' | ||
656 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
657 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
658 | (eval $ac_try) 2>&5 | ||
659 | ac_status=$? | ||
660 | @@ -17914,8 +17874,7 @@ | ||
661 | cat conftest.err >&5 | ||
662 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
663 | (exit $ac_status); } && | ||
664 | - { ac_try='test -z "$ac_c_werror_flag" | ||
665 | - || test ! -s conftest.err' | ||
666 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
667 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
668 | (eval $ac_try) 2>&5 | ||
669 | ac_status=$? | ||
670 | @@ -17980,8 +17939,7 @@ | ||
671 | cat conftest.err >&5 | ||
672 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
673 | (exit $ac_status); } && | ||
674 | - { ac_try='test -z "$ac_c_werror_flag" | ||
675 | - || test ! -s conftest.err' | ||
676 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
677 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
678 | (eval $ac_try) 2>&5 | ||
679 | ac_status=$? | ||
680 | @@ -18047,8 +18005,7 @@ | ||
681 | cat conftest.err >&5 | ||
682 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
683 | (exit $ac_status); } && | ||
684 | - { ac_try='test -z "$ac_c_werror_flag" | ||
685 | - || test ! -s conftest.err' | ||
686 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
687 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
688 | (eval $ac_try) 2>&5 | ||
689 | ac_status=$? | ||
690 | @@ -18114,8 +18071,7 @@ | ||
691 | cat conftest.err >&5 | ||
692 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
693 | (exit $ac_status); } && | ||
694 | - { ac_try='test -z "$ac_c_werror_flag" | ||
695 | - || test ! -s conftest.err' | ||
696 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
697 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
698 | (eval $ac_try) 2>&5 | ||
699 | ac_status=$? | ||
700 | @@ -18190,7 +18146,7 @@ | ||
701 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
702 | lt_status=$lt_dlunknown | ||
703 | cat > conftest.$ac_ext <<EOF | ||
704 | -#line 18193 "configure" | ||
705 | +#line 18149 "configure" | ||
706 | #include "confdefs.h" | ||
707 | |||
708 | #if HAVE_DLFCN_H | ||
709 | @@ -18288,7 +18244,7 @@ | ||
710 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
711 | lt_status=$lt_dlunknown | ||
712 | cat > conftest.$ac_ext <<EOF | ||
713 | -#line 18291 "configure" | ||
714 | +#line 18247 "configure" | ||
715 | #include "confdefs.h" | ||
716 | |||
717 | #if HAVE_DLFCN_H | ||
718 | @@ -19354,8 +19310,7 @@ | ||
719 | cat conftest.err >&5 | ||
720 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
721 | (exit $ac_status); } && | ||
722 | - { ac_try='test -z "$ac_c_werror_flag" | ||
723 | - || test ! -s conftest.err' | ||
724 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
725 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
726 | (eval $ac_try) 2>&5 | ||
727 | ac_status=$? | ||
728 | @@ -19384,8 +19339,7 @@ | ||
729 | cat conftest.err >&5 | ||
730 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
731 | (exit $ac_status); } && | ||
732 | - { ac_try='test -z "$ac_c_werror_flag" | ||
733 | - || test ! -s conftest.err' | ||
734 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
735 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
736 | (eval $ac_try) 2>&5 | ||
737 | ac_status=$? | ||
738 | @@ -19455,8 +19409,7 @@ | ||
739 | cat conftest.err >&5 | ||
740 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
741 | (exit $ac_status); } && | ||
742 | - { ac_try='test -z "$ac_c_werror_flag" | ||
743 | - || test ! -s conftest.err' | ||
744 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
745 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
746 | (eval $ac_try) 2>&5 | ||
747 | ac_status=$? | ||
748 | @@ -19508,8 +19461,7 @@ | ||
749 | cat conftest.err >&5 | ||
750 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
751 | (exit $ac_status); } && | ||
752 | - { ac_try='test -z "$ac_c_werror_flag" | ||
753 | - || test ! -s conftest.err' | ||
754 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
755 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
756 | (eval $ac_try) 2>&5 | ||
757 | ac_status=$? | ||
758 | @@ -19580,8 +19532,7 @@ | ||
759 | cat conftest.err >&5 | ||
760 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
761 | (exit $ac_status); } && | ||
762 | - { ac_try='test -z "$ac_c_werror_flag" | ||
763 | - || test ! -s conftest.err' | ||
764 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
765 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
766 | (eval $ac_try) 2>&5 | ||
767 | ac_status=$? | ||
768 | @@ -19633,8 +19584,7 @@ | ||
769 | cat conftest.err >&5 | ||
770 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
771 | (exit $ac_status); } && | ||
772 | - { ac_try='test -z "$ac_c_werror_flag" | ||
773 | - || test ! -s conftest.err' | ||
774 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
775 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
776 | (eval $ac_try) 2>&5 | ||
777 | ac_status=$? | ||
778 | @@ -19849,6 +19799,18 @@ | ||
779 | else | ||
780 | enable_visibility=yes | ||
781 | fi; | ||
782 | +# modification for Device to disable keyboard shortcuts | ||
783 | +# Check whether --enable-shortcuts or --disable-shortcuts was given. | ||
784 | +if test "${enable_shortcuts+set}" = set; then | ||
785 | + enableval="$enable_shortcuts" | ||
786 | + | ||
787 | +else | ||
788 | + enable_shortcuts=yes | ||
789 | +fi; | ||
790 | + | ||
791 | +if test "x$enable_shortcuts" = "xno"; then | ||
792 | + GTK_EXTRA_CFLAGS="$GTK_EXTRA_CFLAGS -DDISABLE_KEYBOARD_SHORTCUTS" | ||
793 | +fi; | ||
794 | |||
795 | |||
796 | # Check whether --with-xinput or --without-xinput was given. | ||
797 | @@ -20018,8 +19980,7 @@ | ||
798 | cat conftest.err >&5 | ||
799 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
800 | (exit $ac_status); } && | ||
801 | - { ac_try='test -z "$ac_c_werror_flag" | ||
802 | - || test ! -s conftest.err' | ||
803 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
804 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
805 | (eval $ac_try) 2>&5 | ||
806 | ac_status=$? | ||
807 | @@ -20124,8 +20085,7 @@ | ||
808 | cat conftest.err >&5 | ||
809 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
810 | (exit $ac_status); } && | ||
811 | - { ac_try='test -z "$ac_c_werror_flag" | ||
812 | - || test ! -s conftest.err' | ||
813 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
814 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
815 | (eval $ac_try) 2>&5 | ||
816 | ac_status=$? | ||
817 | @@ -20652,8 +20612,7 @@ | ||
818 | cat conftest.err >&5 | ||
819 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
820 | (exit $ac_status); } && | ||
821 | - { ac_try='test -z "$ac_c_werror_flag" | ||
822 | - || test ! -s conftest.err' | ||
823 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
824 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
825 | (eval $ac_try) 2>&5 | ||
826 | ac_status=$? | ||
827 | @@ -20716,8 +20675,7 @@ | ||
828 | cat conftest.err >&5 | ||
829 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
830 | (exit $ac_status); } && | ||
831 | - { ac_try='test -z "$ac_c_werror_flag" | ||
832 | - || test ! -s conftest.err' | ||
833 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
834 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
835 | (eval $ac_try) 2>&5 | ||
836 | ac_status=$? | ||
837 | @@ -20753,7 +20711,7 @@ | ||
838 | # sure that both po/ and po-properties/ have .po files that correspond | ||
839 | # to your language. If you only add one to po/, the build will break | ||
840 | # in po-properties/. | ||
841 | -ALL_LINGUAS="af am ar az az_IR be bg bn br bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu ia id is it ja ko li lt lv mi mk ml mn mr ms nb ne nl nn no nso pa pl pt pt_BR ro ru rw sk sl sq sr sr@ije sr@Latn sv ta th tk tr uk uz uz@Latn vi wa xh yi zh_CN zh_TW" | ||
842 | +ALL_LINGUAS="" | ||
843 | |||
844 | |||
845 | for ac_header in locale.h | ||
846 | @@ -20789,8 +20747,7 @@ | ||
847 | cat conftest.err >&5 | ||
848 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
849 | (exit $ac_status); } && | ||
850 | - { ac_try='test -z "$ac_c_werror_flag" | ||
851 | - || test ! -s conftest.err' | ||
852 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
853 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
854 | (eval $ac_try) 2>&5 | ||
855 | ac_status=$? | ||
856 | @@ -20935,8 +20892,7 @@ | ||
857 | cat conftest.err >&5 | ||
858 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
859 | (exit $ac_status); } && | ||
860 | - { ac_try='test -z "$ac_c_werror_flag" | ||
861 | - || test ! -s conftest.err' | ||
862 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
863 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
864 | (eval $ac_try) 2>&5 | ||
865 | ac_status=$? | ||
866 | @@ -21007,8 +20963,7 @@ | ||
867 | cat conftest.err >&5 | ||
868 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
869 | (exit $ac_status); } && | ||
870 | - { ac_try='test -z "$ac_c_werror_flag" | ||
871 | - || test ! -s conftest.err' | ||
872 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
873 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
874 | (eval $ac_try) 2>&5 | ||
875 | ac_status=$? | ||
876 | @@ -21152,8 +21107,7 @@ | ||
877 | cat conftest.err >&5 | ||
878 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
879 | (exit $ac_status); } && | ||
880 | - { ac_try='test -z "$ac_c_werror_flag" | ||
881 | - || test ! -s conftest.err' | ||
882 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
883 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
884 | (eval $ac_try) 2>&5 | ||
885 | ac_status=$? | ||
886 | @@ -21211,8 +21165,7 @@ | ||
887 | cat conftest.err >&5 | ||
888 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
889 | (exit $ac_status); } && | ||
890 | - { ac_try='test -z "$ac_c_werror_flag" | ||
891 | - || test ! -s conftest.err' | ||
892 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
893 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
894 | (eval $ac_try) 2>&5 | ||
895 | ac_status=$? | ||
896 | @@ -21309,8 +21262,7 @@ | ||
897 | cat conftest.err >&5 | ||
898 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
899 | (exit $ac_status); } && | ||
900 | - { ac_try='test -z "$ac_c_werror_flag" | ||
901 | - || test ! -s conftest.err' | ||
902 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
903 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
904 | (eval $ac_try) 2>&5 | ||
905 | ac_status=$? | ||
906 | @@ -21389,8 +21341,7 @@ | ||
907 | cat conftest.err >&5 | ||
908 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
909 | (exit $ac_status); } && | ||
910 | - { ac_try='test -z "$ac_c_werror_flag" | ||
911 | - || test ! -s conftest.err' | ||
912 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
913 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
914 | (eval $ac_try) 2>&5 | ||
915 | ac_status=$? | ||
916 | @@ -21454,8 +21405,7 @@ | ||
917 | cat conftest.err >&5 | ||
918 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
919 | (exit $ac_status); } && | ||
920 | - { ac_try='test -z "$ac_c_werror_flag" | ||
921 | - || test ! -s conftest.err' | ||
922 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
923 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
924 | (eval $ac_try) 2>&5 | ||
925 | ac_status=$? | ||
926 | @@ -21519,8 +21469,7 @@ | ||
927 | cat conftest.err >&5 | ||
928 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
929 | (exit $ac_status); } && | ||
930 | - { ac_try='test -z "$ac_c_werror_flag" | ||
931 | - || test ! -s conftest.err' | ||
932 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
933 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
934 | (eval $ac_try) 2>&5 | ||
935 | ac_status=$? | ||
936 | @@ -21597,8 +21546,7 @@ | ||
937 | cat conftest.err >&5 | ||
938 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
939 | (exit $ac_status); } && | ||
940 | - { ac_try='test -z "$ac_c_werror_flag" | ||
941 | - || test ! -s conftest.err' | ||
942 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
943 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
944 | (eval $ac_try) 2>&5 | ||
945 | ac_status=$? | ||
946 | @@ -21662,8 +21610,7 @@ | ||
947 | cat conftest.err >&5 | ||
948 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
949 | (exit $ac_status); } && | ||
950 | - { ac_try='test -z "$ac_c_werror_flag" | ||
951 | - || test ! -s conftest.err' | ||
952 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
953 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
954 | (eval $ac_try) 2>&5 | ||
955 | ac_status=$? | ||
956 | @@ -21779,8 +21726,7 @@ | ||
957 | cat conftest.err >&5 | ||
958 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
959 | (exit $ac_status); } && | ||
960 | - { ac_try='test -z "$ac_c_werror_flag" | ||
961 | - || test ! -s conftest.err' | ||
962 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
963 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
964 | (eval $ac_try) 2>&5 | ||
965 | ac_status=$? | ||
966 | @@ -21947,8 +21893,7 @@ | ||
967 | cat conftest.err >&5 | ||
968 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
969 | (exit $ac_status); } && | ||
970 | - { ac_try='test -z "$ac_c_werror_flag" | ||
971 | - || test ! -s conftest.err' | ||
972 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
973 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
974 | (eval $ac_try) 2>&5 | ||
975 | ac_status=$? | ||
976 | @@ -22081,8 +22026,7 @@ | ||
977 | cat conftest.err >&5 | ||
978 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
979 | (exit $ac_status); } && | ||
980 | - { ac_try='test -z "$ac_c_werror_flag" | ||
981 | - || test ! -s conftest.err' | ||
982 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
983 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
984 | (eval $ac_try) 2>&5 | ||
985 | ac_status=$? | ||
986 | @@ -22167,8 +22111,7 @@ | ||
987 | cat conftest.err >&5 | ||
988 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
989 | (exit $ac_status); } && | ||
990 | - { ac_try='test -z "$ac_c_werror_flag" | ||
991 | - || test ! -s conftest.err' | ||
992 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
993 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
994 | (eval $ac_try) 2>&5 | ||
995 | ac_status=$? | ||
996 | @@ -22469,8 +22412,7 @@ | ||
997 | cat conftest.err >&5 | ||
998 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
999 | (exit $ac_status); } && | ||
1000 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1001 | - || test ! -s conftest.err' | ||
1002 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1003 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1004 | (eval $ac_try) 2>&5 | ||
1005 | ac_status=$? | ||
1006 | @@ -22514,8 +22456,7 @@ | ||
1007 | cat conftest.err >&5 | ||
1008 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1009 | (exit $ac_status); } && | ||
1010 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1011 | - || test ! -s conftest.err' | ||
1012 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1013 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1014 | (eval $ac_try) 2>&5 | ||
1015 | ac_status=$? | ||
1016 | @@ -22822,8 +22763,7 @@ | ||
1017 | cat conftest.err >&5 | ||
1018 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1019 | (exit $ac_status); } && | ||
1020 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1021 | - || test ! -s conftest.err' | ||
1022 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1023 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1024 | (eval $ac_try) 2>&5 | ||
1025 | ac_status=$? | ||
1026 | @@ -22949,8 +22889,7 @@ | ||
1027 | cat conftest.err >&5 | ||
1028 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1029 | (exit $ac_status); } && | ||
1030 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1031 | - || test ! -s conftest.err' | ||
1032 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1033 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1034 | (eval $ac_try) 2>&5 | ||
1035 | ac_status=$? | ||
1036 | @@ -23018,8 +22957,7 @@ | ||
1037 | cat conftest.err >&5 | ||
1038 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1039 | (exit $ac_status); } && | ||
1040 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1041 | - || test ! -s conftest.err' | ||
1042 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1043 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1044 | (eval $ac_try) 2>&5 | ||
1045 | ac_status=$? | ||
1046 | @@ -23171,8 +23109,7 @@ | ||
1047 | cat conftest.err >&5 | ||
1048 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1049 | (exit $ac_status); } && | ||
1050 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1051 | - || test ! -s conftest.err' | ||
1052 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1053 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1054 | (eval $ac_try) 2>&5 | ||
1055 | ac_status=$? | ||
1056 | @@ -23324,8 +23261,7 @@ | ||
1057 | cat conftest.err >&5 | ||
1058 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1059 | (exit $ac_status); } && | ||
1060 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1061 | - || test ! -s conftest.err' | ||
1062 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1063 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1064 | (eval $ac_try) 2>&5 | ||
1065 | ac_status=$? | ||
1066 | @@ -23486,8 +23422,7 @@ | ||
1067 | cat conftest.err >&5 | ||
1068 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1069 | (exit $ac_status); } && | ||
1070 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1071 | - || test ! -s conftest.err' | ||
1072 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1073 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1074 | (eval $ac_try) 2>&5 | ||
1075 | ac_status=$? | ||
1076 | @@ -23572,8 +23507,7 @@ | ||
1077 | cat conftest.err >&5 | ||
1078 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1079 | (exit $ac_status); } && | ||
1080 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1081 | - || test ! -s conftest.err' | ||
1082 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1083 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1084 | (eval $ac_try) 2>&5 | ||
1085 | ac_status=$? | ||
1086 | @@ -23666,8 +23600,7 @@ | ||
1087 | cat conftest.err >&5 | ||
1088 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1089 | (exit $ac_status); } && | ||
1090 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1091 | - || test ! -s conftest.err' | ||
1092 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1093 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1094 | (eval $ac_try) 2>&5 | ||
1095 | ac_status=$? | ||
1096 | @@ -23876,8 +23809,7 @@ | ||
1097 | cat conftest.err >&5 | ||
1098 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1099 | (exit $ac_status); } && | ||
1100 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1101 | - || test ! -s conftest.err' | ||
1102 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1103 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1104 | (eval $ac_try) 2>&5 | ||
1105 | ac_status=$? | ||
1106 | @@ -23949,8 +23881,7 @@ | ||
1107 | cat conftest.err >&5 | ||
1108 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1109 | (exit $ac_status); } && | ||
1110 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1111 | - || test ! -s conftest.err' | ||
1112 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1113 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1114 | (eval $ac_try) 2>&5 | ||
1115 | ac_status=$? | ||
1116 | @@ -24014,8 +23945,7 @@ | ||
1117 | cat conftest.err >&5 | ||
1118 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1119 | (exit $ac_status); } && | ||
1120 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1121 | - || test ! -s conftest.err' | ||
1122 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1123 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1124 | (eval $ac_try) 2>&5 | ||
1125 | ac_status=$? | ||
1126 | @@ -24199,8 +24129,7 @@ | ||
1127 | cat conftest.err >&5 | ||
1128 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1129 | (exit $ac_status); } && | ||
1130 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1131 | - || test ! -s conftest.err' | ||
1132 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1133 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1134 | (eval $ac_try) 2>&5 | ||
1135 | ac_status=$? | ||
1136 | @@ -24477,8 +24406,7 @@ | ||
1137 | cat conftest.err >&5 | ||
1138 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1139 | (exit $ac_status); } && | ||
1140 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1141 | - || test ! -s conftest.err' | ||
1142 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1143 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1144 | (eval $ac_try) 2>&5 | ||
1145 | ac_status=$? | ||
1146 | @@ -24579,8 +24507,7 @@ | ||
1147 | cat conftest.err >&5 | ||
1148 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1149 | (exit $ac_status); } && | ||
1150 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1151 | - || test ! -s conftest.err' | ||
1152 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1153 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1154 | (eval $ac_try) 2>&5 | ||
1155 | ac_status=$? | ||
1156 | @@ -24678,8 +24605,7 @@ | ||
1157 | cat conftest.err >&5 | ||
1158 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1159 | (exit $ac_status); } && | ||
1160 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1161 | - || test ! -s conftest.err' | ||
1162 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1163 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1164 | (eval $ac_try) 2>&5 | ||
1165 | ac_status=$? | ||
1166 | @@ -24896,8 +24822,7 @@ | ||
1167 | cat conftest.err >&5 | ||
1168 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1169 | (exit $ac_status); } && | ||
1170 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1171 | - || test ! -s conftest.err' | ||
1172 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1173 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1174 | (eval $ac_try) 2>&5 | ||
1175 | ac_status=$? | ||
1176 | @@ -24962,8 +24887,7 @@ | ||
1177 | cat conftest.err >&5 | ||
1178 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1179 | (exit $ac_status); } && | ||
1180 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1181 | - || test ! -s conftest.err' | ||
1182 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1183 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1184 | (eval $ac_try) 2>&5 | ||
1185 | ac_status=$? | ||
1186 | @@ -25037,8 +24961,7 @@ | ||
1187 | cat conftest.err >&5 | ||
1188 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1189 | (exit $ac_status); } && | ||
1190 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1191 | - || test ! -s conftest.err' | ||
1192 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1193 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1194 | (eval $ac_try) 2>&5 | ||
1195 | ac_status=$? | ||
1196 | @@ -25249,8 +25172,7 @@ | ||
1197 | cat conftest.err >&5 | ||
1198 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1199 | (exit $ac_status); } && | ||
1200 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1201 | - || test ! -s conftest.err' | ||
1202 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1203 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1204 | (eval $ac_try) 2>&5 | ||
1205 | ac_status=$? | ||
1206 | @@ -25306,8 +25228,7 @@ | ||
1207 | cat conftest.err >&5 | ||
1208 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1209 | (exit $ac_status); } && | ||
1210 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1211 | - || test ! -s conftest.err' | ||
1212 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1213 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1214 | (eval $ac_try) 2>&5 | ||
1215 | ac_status=$? | ||
1216 | @@ -25460,8 +25381,7 @@ | ||
1217 | cat conftest.err >&5 | ||
1218 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1219 | (exit $ac_status); } && | ||
1220 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1221 | - || test ! -s conftest.err' | ||
1222 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1223 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1224 | (eval $ac_try) 2>&5 | ||
1225 | ac_status=$? | ||
1226 | @@ -25517,8 +25437,7 @@ | ||
1227 | cat conftest.err >&5 | ||
1228 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1229 | (exit $ac_status); } && | ||
1230 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1231 | - || test ! -s conftest.err' | ||
1232 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1233 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1234 | (eval $ac_try) 2>&5 | ||
1235 | ac_status=$? | ||
1236 | @@ -25671,8 +25590,7 @@ | ||
1237 | cat conftest.err >&5 | ||
1238 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1239 | (exit $ac_status); } && | ||
1240 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1241 | - || test ! -s conftest.err' | ||
1242 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1243 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1244 | (eval $ac_try) 2>&5 | ||
1245 | ac_status=$? | ||
1246 | @@ -25728,8 +25646,7 @@ | ||
1247 | cat conftest.err >&5 | ||
1248 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1249 | (exit $ac_status); } && | ||
1250 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1251 | - || test ! -s conftest.err' | ||
1252 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1253 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1254 | (eval $ac_try) 2>&5 | ||
1255 | ac_status=$? | ||
1256 | @@ -25905,8 +25822,7 @@ | ||
1257 | cat conftest.err >&5 | ||
1258 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1259 | (exit $ac_status); } && | ||
1260 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1261 | - || test ! -s conftest.err' | ||
1262 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1263 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1264 | (eval $ac_try) 2>&5 | ||
1265 | ac_status=$? | ||
1266 | @@ -26022,8 +25938,7 @@ | ||
1267 | cat conftest.err >&5 | ||
1268 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1269 | (exit $ac_status); } && | ||
1270 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1271 | - || test ! -s conftest.err' | ||
1272 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1273 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1274 | (eval $ac_try) 2>&5 | ||
1275 | ac_status=$? | ||
1276 | @@ -26127,8 +26042,7 @@ | ||
1277 | cat conftest.err >&5 | ||
1278 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1279 | (exit $ac_status); } && | ||
1280 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1281 | - || test ! -s conftest.err' | ||
1282 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1283 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1284 | (eval $ac_try) 2>&5 | ||
1285 | ac_status=$? | ||
1286 | @@ -26184,8 +26098,7 @@ | ||
1287 | cat conftest.err >&5 | ||
1288 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1289 | (exit $ac_status); } && | ||
1290 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1291 | - || test ! -s conftest.err' | ||
1292 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1293 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1294 | (eval $ac_try) 2>&5 | ||
1295 | ac_status=$? | ||
1296 | @@ -26330,8 +26243,7 @@ | ||
1297 | cat conftest.err >&5 | ||
1298 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1299 | (exit $ac_status); } && | ||
1300 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1301 | - || test ! -s conftest.err' | ||
1302 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1303 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1304 | (eval $ac_try) 2>&5 | ||
1305 | ac_status=$? | ||
1306 | @@ -26488,8 +26400,7 @@ | ||
1307 | cat conftest.err >&5 | ||
1308 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1309 | (exit $ac_status); } && | ||
1310 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1311 | - || test ! -s conftest.err' | ||
1312 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1313 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1314 | (eval $ac_try) 2>&5 | ||
1315 | ac_status=$? | ||
1316 | @@ -26560,8 +26471,7 @@ | ||
1317 | cat conftest.err >&5 | ||
1318 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1319 | (exit $ac_status); } && | ||
1320 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1321 | - || test ! -s conftest.err' | ||
1322 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1323 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1324 | (eval $ac_try) 2>&5 | ||
1325 | ac_status=$? | ||
1326 | @@ -26881,8 +26791,7 @@ | ||
1327 | cat conftest.err >&5 | ||
1328 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1329 | (exit $ac_status); } && | ||
1330 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1331 | - || test ! -s conftest.err' | ||
1332 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1333 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1334 | (eval $ac_try) 2>&5 | ||
1335 | ac_status=$? | ||
1336 | @@ -26939,8 +26848,7 @@ | ||
1337 | cat conftest.err >&5 | ||
1338 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1339 | (exit $ac_status); } && | ||
1340 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1341 | - || test ! -s conftest.err' | ||
1342 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1343 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1344 | (eval $ac_try) 2>&5 | ||
1345 | ac_status=$? | ||
1346 | @@ -27183,8 +27091,7 @@ | ||
1347 | cat conftest.err >&5 | ||
1348 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1349 | (exit $ac_status); } && | ||
1350 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1351 | - || test ! -s conftest.err' | ||
1352 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1353 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1354 | (eval $ac_try) 2>&5 | ||
1355 | ac_status=$? | ||
1356 | @@ -27295,8 +27202,7 @@ | ||
1357 | cat conftest.err >&5 | ||
1358 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1359 | (exit $ac_status); } && | ||
1360 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1361 | - || test ! -s conftest.err' | ||
1362 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1363 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1364 | (eval $ac_try) 2>&5 | ||
1365 | ac_status=$? | ||
1366 | @@ -27347,8 +27253,7 @@ | ||
1367 | cat conftest.err >&5 | ||
1368 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1369 | (exit $ac_status); } && | ||
1370 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1371 | - || test ! -s conftest.err' | ||
1372 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1373 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1374 | (eval $ac_try) 2>&5 | ||
1375 | ac_status=$? | ||
1376 | @@ -27424,8 +27329,7 @@ | ||
1377 | cat conftest.err >&5 | ||
1378 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1379 | (exit $ac_status); } && | ||
1380 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1381 | - || test ! -s conftest.err' | ||
1382 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1383 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1384 | (eval $ac_try) 2>&5 | ||
1385 | ac_status=$? | ||
1386 | @@ -27480,8 +27384,7 @@ | ||
1387 | cat conftest.err >&5 | ||
1388 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1389 | (exit $ac_status); } && | ||
1390 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1391 | - || test ! -s conftest.err' | ||
1392 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1393 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1394 | (eval $ac_try) 2>&5 | ||
1395 | ac_status=$? | ||
1396 | @@ -27549,8 +27452,7 @@ | ||
1397 | cat conftest.err >&5 | ||
1398 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1399 | (exit $ac_status); } && | ||
1400 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1401 | - || test ! -s conftest.err' | ||
1402 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1403 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1404 | (eval $ac_try) 2>&5 | ||
1405 | ac_status=$? | ||
1406 | @@ -27658,8 +27560,7 @@ | ||
1407 | cat conftest.err >&5 | ||
1408 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1409 | (exit $ac_status); } && | ||
1410 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1411 | - || test ! -s conftest.err' | ||
1412 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1413 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1414 | (eval $ac_try) 2>&5 | ||
1415 | ac_status=$? | ||
1416 | @@ -27723,8 +27624,7 @@ | ||
1417 | cat conftest.err >&5 | ||
1418 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1419 | (exit $ac_status); } && | ||
1420 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1421 | - || test ! -s conftest.err' | ||
1422 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1423 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1424 | (eval $ac_try) 2>&5 | ||
1425 | ac_status=$? | ||
1426 | @@ -27792,8 +27692,7 @@ | ||
1427 | cat conftest.err >&5 | ||
1428 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1429 | (exit $ac_status); } && | ||
1430 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1431 | - || test ! -s conftest.err' | ||
1432 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1433 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1434 | (eval $ac_try) 2>&5 | ||
1435 | ac_status=$? | ||
1436 | @@ -27897,8 +27796,7 @@ | ||
1437 | cat conftest.err >&5 | ||
1438 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1439 | (exit $ac_status); } && | ||
1440 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1441 | - || test ! -s conftest.err' | ||
1442 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1443 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1444 | (eval $ac_try) 2>&5 | ||
1445 | ac_status=$? | ||
1446 | @@ -27962,8 +27860,7 @@ | ||
1447 | cat conftest.err >&5 | ||
1448 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1449 | (exit $ac_status); } && | ||
1450 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1451 | - || test ! -s conftest.err' | ||
1452 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1453 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1454 | (eval $ac_try) 2>&5 | ||
1455 | ac_status=$? | ||
1456 | @@ -28060,8 +27957,7 @@ | ||
1457 | cat conftest.err >&5 | ||
1458 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1459 | (exit $ac_status); } && | ||
1460 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1461 | - || test ! -s conftest.err' | ||
1462 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1463 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1464 | (eval $ac_try) 2>&5 | ||
1465 | ac_status=$? | ||
1466 | @@ -28125,8 +28021,7 @@ | ||
1467 | cat conftest.err >&5 | ||
1468 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1469 | (exit $ac_status); } && | ||
1470 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1471 | - || test ! -s conftest.err' | ||
1472 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1473 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1474 | (eval $ac_try) 2>&5 | ||
1475 | ac_status=$? | ||
1476 | @@ -28223,8 +28118,7 @@ | ||
1477 | cat conftest.err >&5 | ||
1478 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1479 | (exit $ac_status); } && | ||
1480 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1481 | - || test ! -s conftest.err' | ||
1482 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1483 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1484 | (eval $ac_try) 2>&5 | ||
1485 | ac_status=$? | ||
1486 | @@ -28288,8 +28182,7 @@ | ||
1487 | cat conftest.err >&5 | ||
1488 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1489 | (exit $ac_status); } && | ||
1490 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1491 | - || test ! -s conftest.err' | ||
1492 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1493 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1494 | (eval $ac_try) 2>&5 | ||
1495 | ac_status=$? | ||
1496 | @@ -28368,8 +28261,7 @@ | ||
1497 | cat conftest.err >&5 | ||
1498 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1499 | (exit $ac_status); } && | ||
1500 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1501 | - || test ! -s conftest.err' | ||
1502 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1503 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1504 | (eval $ac_try) 2>&5 | ||
1505 | ac_status=$? | ||
1506 | @@ -28462,8 +28354,7 @@ | ||
1507 | cat conftest.err >&5 | ||
1508 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1509 | (exit $ac_status); } && | ||
1510 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1511 | - || test ! -s conftest.err' | ||
1512 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1513 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1514 | (eval $ac_try) 2>&5 | ||
1515 | ac_status=$? | ||
1516 | @@ -28537,8 +28428,7 @@ | ||
1517 | cat conftest.err >&5 | ||
1518 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1519 | (exit $ac_status); } && | ||
1520 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1521 | - || test ! -s conftest.err' | ||
1522 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1523 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1524 | (eval $ac_try) 2>&5 | ||
1525 | ac_status=$? | ||
1526 | @@ -28609,8 +28499,7 @@ | ||
1527 | cat conftest.err >&5 | ||
1528 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1529 | (exit $ac_status); } && | ||
1530 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1531 | - || test ! -s conftest.err' | ||
1532 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1533 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1534 | (eval $ac_try) 2>&5 | ||
1535 | ac_status=$? | ||
1536 | @@ -28709,8 +28598,7 @@ | ||
1537 | cat conftest.err >&5 | ||
1538 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1539 | (exit $ac_status); } && | ||
1540 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1541 | - || test ! -s conftest.err' | ||
1542 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1543 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1544 | (eval $ac_try) 2>&5 | ||
1545 | ac_status=$? | ||
1546 | @@ -28766,8 +28654,7 @@ | ||
1547 | cat conftest.err >&5 | ||
1548 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1549 | (exit $ac_status); } && | ||
1550 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1551 | - || test ! -s conftest.err' | ||
1552 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1553 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1554 | (eval $ac_try) 2>&5 | ||
1555 | ac_status=$? | ||
1556 | @@ -28856,8 +28743,7 @@ | ||
1557 | cat conftest.err >&5 | ||
1558 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1559 | (exit $ac_status); } && | ||
1560 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1561 | - || test ! -s conftest.err' | ||
1562 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1563 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1564 | (eval $ac_try) 2>&5 | ||
1565 | ac_status=$? | ||
1566 | @@ -28907,8 +28793,7 @@ | ||
1567 | cat conftest.err >&5 | ||
1568 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1569 | (exit $ac_status); } && | ||
1570 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1571 | - || test ! -s conftest.err' | ||
1572 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1573 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1574 | (eval $ac_try) 2>&5 | ||
1575 | ac_status=$? | ||
1576 | @@ -28999,8 +28884,7 @@ | ||
1577 | cat conftest.err >&5 | ||
1578 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1579 | (exit $ac_status); } && | ||
1580 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1581 | - || test ! -s conftest.err' | ||
1582 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1583 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1584 | (eval $ac_try) 2>&5 | ||
1585 | ac_status=$? | ||
1586 | @@ -29043,8 +28927,7 @@ | ||
1587 | cat conftest.err >&5 | ||
1588 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1589 | (exit $ac_status); } && | ||
1590 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1591 | - || test ! -s conftest.err' | ||
1592 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1593 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1594 | (eval $ac_try) 2>&5 | ||
1595 | ac_status=$? | ||
1596 | @@ -29119,8 +29002,7 @@ | ||
1597 | cat conftest.err >&5 | ||
1598 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1599 | (exit $ac_status); } && | ||
1600 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1601 | - || test ! -s conftest.err' | ||
1602 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1603 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1604 | (eval $ac_try) 2>&5 | ||
1605 | ac_status=$? | ||
1606 | @@ -29198,8 +29080,7 @@ | ||
1607 | cat conftest.err >&5 | ||
1608 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1609 | (exit $ac_status); } && | ||
1610 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1611 | - || test ! -s conftest.err' | ||
1612 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1613 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1614 | (eval $ac_try) 2>&5 | ||
1615 | ac_status=$? | ||
1616 | @@ -29272,8 +29153,7 @@ | ||
1617 | cat conftest.err >&5 | ||
1618 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1619 | (exit $ac_status); } && | ||
1620 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1621 | - || test ! -s conftest.err' | ||
1622 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1623 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1624 | (eval $ac_try) 2>&5 | ||
1625 | ac_status=$? | ||
1626 | @@ -29350,8 +29230,7 @@ | ||
1627 | cat conftest.err >&5 | ||
1628 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1629 | (exit $ac_status); } && | ||
1630 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1631 | - || test ! -s conftest.err' | ||
1632 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1633 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1634 | (eval $ac_try) 2>&5 | ||
1635 | ac_status=$? | ||
1636 | @@ -29447,8 +29326,7 @@ | ||
1637 | cat conftest.err >&5 | ||
1638 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1639 | (exit $ac_status); } && | ||
1640 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1641 | - || test ! -s conftest.err' | ||
1642 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1643 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1644 | (eval $ac_try) 2>&5 | ||
1645 | ac_status=$? | ||
1646 | @@ -29558,8 +29436,7 @@ | ||
1647 | cat conftest.err >&5 | ||
1648 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1649 | (exit $ac_status); } && | ||
1650 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1651 | - || test ! -s conftest.err' | ||
1652 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1653 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1654 | (eval $ac_try) 2>&5 | ||
1655 | ac_status=$? | ||
1656 | @@ -29609,8 +29486,7 @@ | ||
1657 | cat conftest.err >&5 | ||
1658 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1659 | (exit $ac_status); } && | ||
1660 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1661 | - || test ! -s conftest.err' | ||
1662 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1663 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1664 | (eval $ac_try) 2>&5 | ||
1665 | ac_status=$? | ||
1666 | @@ -29809,8 +29685,7 @@ | ||
1667 | cat conftest.err >&5 | ||
1668 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1669 | (exit $ac_status); } && | ||
1670 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1671 | - || test ! -s conftest.err' | ||
1672 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1673 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1674 | (eval $ac_try) 2>&5 | ||
1675 | ac_status=$? | ||
1676 | @@ -29860,8 +29735,7 @@ | ||
1677 | cat conftest.err >&5 | ||
1678 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1679 | (exit $ac_status); } && | ||
1680 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1681 | - || test ! -s conftest.err' | ||
1682 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1683 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1684 | (eval $ac_try) 2>&5 | ||
1685 | ac_status=$? | ||
1686 | @@ -30015,6 +29889,116 @@ | ||
1687 | GDK_EXTRA_LIBS="`$PKG_CONFIG --libs xfixes` $GDK_EXTRA_LIBS" | ||
1688 | fi | ||
1689 | |||
1690 | + # Checks for XFixes extension | ||
1691 | + | ||
1692 | + have_xfixes=false | ||
1693 | + | ||
1694 | + succeeded=no | ||
1695 | + | ||
1696 | + if test -z "$PKG_CONFIG"; then | ||
1697 | + # Extract the first word of "pkg-config", so it can be a program name with args. | ||
1698 | +set dummy pkg-config; ac_word=$2 | ||
1699 | +echo "$as_me:$LINENO: checking for $ac_word" >&5 | ||
1700 | +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 | ||
1701 | +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then | ||
1702 | + echo $ECHO_N "(cached) $ECHO_C" >&6 | ||
1703 | +else | ||
1704 | + case $PKG_CONFIG in | ||
1705 | + [\\/]* | ?:[\\/]*) | ||
1706 | + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. | ||
1707 | + ;; | ||
1708 | + *) | ||
1709 | + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
1710 | +for as_dir in $PATH | ||
1711 | +do | ||
1712 | + IFS=$as_save_IFS | ||
1713 | + test -z "$as_dir" && as_dir=. | ||
1714 | + for ac_exec_ext in '' $ac_executable_extensions; do | ||
1715 | + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | ||
1716 | + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" | ||
1717 | + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||
1718 | + break 2 | ||
1719 | + fi | ||
1720 | +done | ||
1721 | +done | ||
1722 | + | ||
1723 | + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" | ||
1724 | + ;; | ||
1725 | +esac | ||
1726 | +fi | ||
1727 | +PKG_CONFIG=$ac_cv_path_PKG_CONFIG | ||
1728 | + | ||
1729 | +if test -n "$PKG_CONFIG"; then | ||
1730 | + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 | ||
1731 | +echo "${ECHO_T}$PKG_CONFIG" >&6 | ||
1732 | +else | ||
1733 | + echo "$as_me:$LINENO: result: no" >&5 | ||
1734 | +echo "${ECHO_T}no" >&6 | ||
1735 | +fi | ||
1736 | + | ||
1737 | + fi | ||
1738 | + | ||
1739 | + if test "$PKG_CONFIG" = "no" ; then | ||
1740 | + echo "*** The pkg-config script could not be found. Make sure it is" | ||
1741 | + echo "*** in your path, or set the PKG_CONFIG environment variable" | ||
1742 | + echo "*** to the full path to pkg-config." | ||
1743 | + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." | ||
1744 | + else | ||
1745 | + PKG_CONFIG_MIN_VERSION=0.9.0 | ||
1746 | + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then | ||
1747 | + echo "$as_me:$LINENO: checking for xfixes" >&5 | ||
1748 | +echo $ECHO_N "checking for xfixes... $ECHO_C" >&6 | ||
1749 | + | ||
1750 | + if $PKG_CONFIG --exists "xfixes" ; then | ||
1751 | + echo "$as_me:$LINENO: result: yes" >&5 | ||
1752 | +echo "${ECHO_T}yes" >&6 | ||
1753 | + succeeded=yes | ||
1754 | + | ||
1755 | + echo "$as_me:$LINENO: checking XFIXES_CFLAGS" >&5 | ||
1756 | +echo $ECHO_N "checking XFIXES_CFLAGS... $ECHO_C" >&6 | ||
1757 | + XFIXES_CFLAGS=`$PKG_CONFIG --cflags "xfixes"` | ||
1758 | + echo "$as_me:$LINENO: result: $XFIXES_CFLAGS" >&5 | ||
1759 | +echo "${ECHO_T}$XFIXES_CFLAGS" >&6 | ||
1760 | + | ||
1761 | + echo "$as_me:$LINENO: checking XFIXES_LIBS" >&5 | ||
1762 | +echo $ECHO_N "checking XFIXES_LIBS... $ECHO_C" >&6 | ||
1763 | + XFIXES_LIBS=`$PKG_CONFIG --libs "xfixes"` | ||
1764 | + echo "$as_me:$LINENO: result: $XFIXES_LIBS" >&5 | ||
1765 | +echo "${ECHO_T}$XFIXES_LIBS" >&6 | ||
1766 | + else | ||
1767 | + XFIXES_CFLAGS="" | ||
1768 | + XFIXES_LIBS="" | ||
1769 | + ## If we have a custom action on failure, don't print errors, but | ||
1770 | + ## do set a variable so people can do so. | ||
1771 | + XFIXES_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xfixes"` | ||
1772 | + | ||
1773 | + fi | ||
1774 | + | ||
1775 | + | ||
1776 | + | ||
1777 | + else | ||
1778 | + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." | ||
1779 | + echo "*** See http://www.freedesktop.org/software/pkgconfig" | ||
1780 | + fi | ||
1781 | + fi | ||
1782 | + | ||
1783 | + if test $succeeded = yes; then | ||
1784 | + have_xfixes=true | ||
1785 | + else | ||
1786 | + : | ||
1787 | + fi | ||
1788 | + | ||
1789 | + | ||
1790 | + if $have_xfixes ; then | ||
1791 | + | ||
1792 | +cat >>confdefs.h <<\_ACEOF | ||
1793 | +#define HAVE_XFIXES 1 | ||
1794 | +_ACEOF | ||
1795 | + | ||
1796 | + GDK_EXTRA_CFLAGS="`$PKG_CONFIG --cflags xfixes` $GDK_EXTRA_CFLAGS" | ||
1797 | + GDK_EXTRA_LIBS="`$PKG_CONFIG --libs xfixes` $GDK_EXTRA_LIBS" | ||
1798 | + fi | ||
1799 | + | ||
1800 | # Xshm checks | ||
1801 | |||
1802 | if test "x$enable_shm" = "xyes"; then | ||
1803 | @@ -30049,8 +30033,7 @@ | ||
1804 | cat conftest.err >&5 | ||
1805 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1806 | (exit $ac_status); } && | ||
1807 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1808 | - || test ! -s conftest.err' | ||
1809 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1810 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1811 | (eval $ac_try) 2>&5 | ||
1812 | ac_status=$? | ||
1813 | @@ -30196,8 +30179,7 @@ | ||
1814 | cat conftest.err >&5 | ||
1815 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1816 | (exit $ac_status); } && | ||
1817 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1818 | - || test ! -s conftest.err' | ||
1819 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1820 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1821 | (eval $ac_try) 2>&5 | ||
1822 | ac_status=$? | ||
1823 | @@ -30355,8 +30337,7 @@ | ||
1824 | cat conftest.err >&5 | ||
1825 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1826 | (exit $ac_status); } && | ||
1827 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1828 | - || test ! -s conftest.err' | ||
1829 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1830 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1831 | (eval $ac_try) 2>&5 | ||
1832 | ac_status=$? | ||
1833 | @@ -30651,8 +30632,7 @@ | ||
1834 | cat conftest.err >&5 | ||
1835 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1836 | (exit $ac_status); } && | ||
1837 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1838 | - || test ! -s conftest.err' | ||
1839 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1840 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1841 | (eval $ac_try) 2>&5 | ||
1842 | ac_status=$? | ||
1843 | @@ -30765,8 +30745,7 @@ | ||
1844 | cat conftest.err >&5 | ||
1845 | echo "$as_me:$LINENO: \$? = $ac_status" >&5 | ||
1846 | (exit $ac_status); } && | ||
1847 | - { ac_try='test -z "$ac_c_werror_flag" | ||
1848 | - || test ! -s conftest.err' | ||
1849 | + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' | ||
1850 | { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 | ||
1851 | (eval $ac_try) 2>&5 | ||
1852 | ac_status=$? | ||
1853 | @@ -30798,7 +30777,6 @@ | ||
1854 | |||
1855 | GTK_PACKAGES=atk | ||
1856 | GTK_EXTRA_LIBS= | ||
1857 | -GTK_EXTRA_CFLAGS= | ||
1858 | GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS" | ||
1859 | GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS" | ||
1860 | |||
1861 | @@ -32514,11 +32492,6 @@ | ||
1862 | *) ac_INSTALL=$ac_top_builddir$INSTALL ;; | ||
1863 | esac | ||
1864 | |||
1865 | - if test x"$ac_file" != x-; then | ||
1866 | - { echo "$as_me:$LINENO: creating $ac_file" >&5 | ||
1867 | -echo "$as_me: creating $ac_file" >&6;} | ||
1868 | - rm -f "$ac_file" | ||
1869 | - fi | ||
1870 | # Let's still pretend it is `configure' which instantiates (i.e., don't | ||
1871 | # use $as_me), people would be surprised to read: | ||
1872 | # /* config.h. Generated by config.status. */ | ||
1873 | @@ -32557,6 +32530,12 @@ | ||
1874 | fi;; | ||
1875 | esac | ||
1876 | done` || { (exit 1); exit 1; } | ||
1877 | + | ||
1878 | + if test x"$ac_file" != x-; then | ||
1879 | + { echo "$as_me:$LINENO: creating $ac_file" >&5 | ||
1880 | +echo "$as_me: creating $ac_file" >&6;} | ||
1881 | + rm -f "$ac_file" | ||
1882 | + fi | ||
1883 | _ACEOF | ||
1884 | cat >>$CONFIG_STATUS <<_ACEOF | ||
1885 | sed "$ac_vpsub | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/configure.in.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/configure.in.diff deleted file mode 100644 index 8573b11739..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/configure.in.diff +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | --- gtk+-2.6.4/configure.in 2005-03-30 15:05:06.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/configure.in 2005-03-30 15:07:36.000000000 +0300 | ||
3 | @@ -202,6 +202,15 @@ | ||
4 | [AC_HELP_STRING([--disable-visibility], | ||
5 | [don't use ELF visibility attributes])],, | ||
6 | [enable_visibility=yes]) | ||
7 | +# modification for Device to disable keyboard shortcuts | ||
8 | +AC_ARG_ENABLE(shortcuts, | ||
9 | + [AC_HELP_STRING([--disable-shortcuts], | ||
10 | + [disable keyboard shortcuts])],, | ||
11 | + [enable_shortcuts=yes]) | ||
12 | + | ||
13 | +if test "x$enable_shortcuts" = "xno"; then | ||
14 | + GTK_EXTRA_CFLAGS="$GTK_EXTRA_CFLAGS -DDISABLE_KEYBOARD_SHORTCUTS" | ||
15 | +fi; | ||
16 | |||
17 | AC_ARG_WITH(xinput, | ||
18 | [AC_HELP_STRING([--with-xinput=@<:@no/yes@:>@], [support XInput])]) | ||
19 | @@ -418,7 +427,7 @@ | ||
20 | # sure that both po/ and po-properties/ have .po files that correspond | ||
21 | # to your language. If you only add one to po/, the build will break | ||
22 | # in po-properties/. | ||
23 | -ALL_LINGUAS="af am ar az az_IR be bg bn br bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu ia id is it ja ko li lt lv mi mk ml mn mr ms nb ne nl nn no nso pa pl pt pt_BR ro ru rw sk sl sq sr sr@ije sr@Latn sv ta th tk tr uk uz uz@Latn vi wa xh yi zh_CN zh_TW" | ||
24 | +ALL_LINGUAS="" | ||
25 | AM_GLIB_GNU_GETTEXT | ||
26 | LIBS="$LIBS $INTLLIBS" | ||
27 | AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*) | ||
28 | @@ -1283,6 +1292,17 @@ | ||
29 | GDK_EXTRA_CFLAGS="`$PKG_CONFIG --cflags xfixes` $GDK_EXTRA_CFLAGS" | ||
30 | GDK_EXTRA_LIBS="`$PKG_CONFIG --libs xfixes` $GDK_EXTRA_LIBS" | ||
31 | fi | ||
32 | + | ||
33 | + # Checks for XFixes extension | ||
34 | + | ||
35 | + have_xfixes=false | ||
36 | + PKG_CHECK_MODULES(XFIXES, xfixes, have_xfixes=true, :) | ||
37 | + | ||
38 | + if $have_xfixes ; then | ||
39 | + AC_DEFINE(HAVE_XFIXES, 1, Have the XFIXES X extension) | ||
40 | + GDK_EXTRA_CFLAGS="`$PKG_CONFIG --cflags xfixes` $GDK_EXTRA_CFLAGS" | ||
41 | + GDK_EXTRA_LIBS="`$PKG_CONFIG --libs xfixes` $GDK_EXTRA_LIBS" | ||
42 | + fi | ||
43 | |||
44 | # Xshm checks | ||
45 | |||
46 | @@ -1492,7 +1512,6 @@ | ||
47 | |||
48 | GTK_PACKAGES=atk | ||
49 | GTK_EXTRA_LIBS= | ||
50 | -GTK_EXTRA_CFLAGS= | ||
51 | GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS" | ||
52 | GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS" | ||
53 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/disable-tooltips.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/disable-tooltips.patch deleted file mode 100644 index d71d839c3c..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/disable-tooltips.patch +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --- gtk+-2.4.3/gtk/gtktooltips.c.old 2004-07-04 18:52:04.000000000 +0100 | ||
2 | +++ gtk+-2.4.3/gtk/gtktooltips.c 2004-07-04 18:52:08.000000000 +0100 | ||
3 | @@ -118,7 +118,7 @@ | ||
4 | tooltips->tips_data_list = NULL; | ||
5 | |||
6 | tooltips->delay = DEFAULT_DELAY; | ||
7 | - tooltips->enabled = TRUE; | ||
8 | + tooltips->enabled = FALSE; | ||
9 | tooltips->timer_tag = 0; | ||
10 | tooltips->use_sticky_delay = FALSE; | ||
11 | tooltips->last_popdown.tv_sec = -1; | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gdkwindow-x11.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gdkwindow-x11.c.diff deleted file mode 100644 index 8104eb8559..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gdkwindow-x11.c.diff +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gdk/x11/gdkwindow-x11.c 2005-01-25 20:51:36.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gdk/x11/gdkwindow-x11.c 2005-04-06 16:19:35.350164320 +0300 | ||
3 | @@ -1286,6 +1286,7 @@ | ||
4 | GdkToplevelX11 *toplevel; | ||
5 | Atom atoms[7]; | ||
6 | gint i; | ||
7 | + gint propmode; | ||
8 | |||
9 | private = (GdkWindowObject*) window; | ||
10 | toplevel = _gdk_x11_window_get_toplevel (window); | ||
11 | @@ -1295,6 +1296,12 @@ | ||
12 | |||
13 | update_wm_hints (window, TRUE); | ||
14 | |||
15 | + /* If the window has _NET_WM_STATE key specified, use it as the property mode */ | ||
16 | + propmode = (gint)g_object_get_data (G_OBJECT (window), "_NET_WM_STATE"); | ||
17 | + | ||
18 | + if (!propmode) | ||
19 | + propmode = PropModeReplace; | ||
20 | + | ||
21 | /* We set the spec hints regardless of whether the spec is supported, | ||
22 | * since it can't hurt and it's kind of expensive to check whether | ||
23 | * it's supported. | ||
24 | @@ -1366,10 +1373,11 @@ | ||
25 | XChangeProperty (xdisplay, | ||
26 | xwindow, | ||
27 | gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"), | ||
28 | - XA_ATOM, 32, PropModeReplace, | ||
29 | + XA_ATOM, 32, propmode, | ||
30 | (guchar*) atoms, i); | ||
31 | - } | ||
32 | - else | ||
33 | + } | ||
34 | + /* Don't delete the property, unless we are replacing it */ | ||
35 | + else if (propmode == PropModeReplace ) | ||
36 | { | ||
37 | XDeleteProperty (xdisplay, | ||
38 | xwindow, | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk+-handhelds.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk+-handhelds.patch deleted file mode 100644 index 20481f059b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk+-handhelds.patch +++ /dev/null | |||
@@ -1,236 +0,0 @@ | |||
1 | --- gtk+-2.4.1/gtk/gtkarrow.c 2004-03-13 09:51:13.000000000 +1100 | ||
2 | +++ gtk+-2.4.1/gtk/gtkarrow.c 2004-05-26 14:52:17.000000000 +1000 | ||
3 | @@ -29,7 +29,7 @@ | ||
4 | #include "gtkarrow.h" | ||
5 | #include "gtkintl.h" | ||
6 | |||
7 | -#define MIN_ARROW_SIZE 15 | ||
8 | +#define MIN_ARROW_SIZE 7 | ||
9 | |||
10 | enum { | ||
11 | PROP_0, | ||
12 | @@ -53,6 +53,8 @@ | ||
13 | guint prop_id, | ||
14 | GValue *value, | ||
15 | GParamSpec *pspec); | ||
16 | +static void gtk_arrow_size_request (GtkWidget *arrow, | ||
17 | + GtkRequisition *requisition); | ||
18 | |||
19 | GType | ||
20 | gtk_arrow_get_type (void) | ||
21 | @@ -111,6 +113,7 @@ | ||
22 | G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
23 | |||
24 | widget_class->expose_event = gtk_arrow_expose; | ||
25 | + widget_class->size_request = gtk_arrow_size_request; | ||
26 | } | ||
27 | |||
28 | static void | ||
29 | @@ -166,13 +169,18 @@ | ||
30 | } | ||
31 | |||
32 | static void | ||
33 | +gtk_arrow_size_request (GtkWidget *arrow, | ||
34 | + GtkRequisition *requisition) | ||
35 | +{ | ||
36 | + requisition->width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2; | ||
37 | + requisition->height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2; | ||
38 | +} | ||
39 | + | ||
40 | +static void | ||
41 | gtk_arrow_init (GtkArrow *arrow) | ||
42 | { | ||
43 | GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW); | ||
44 | |||
45 | - GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2; | ||
46 | - GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2; | ||
47 | - | ||
48 | arrow->arrow_type = GTK_ARROW_RIGHT; | ||
49 | arrow->shadow_type = GTK_SHADOW_OUT; | ||
50 | } | ||
51 | --- gtk+-2.4.1/gtk/gtkcalendar.c 2004-03-06 14:37:26.000000000 +1100 | ||
52 | +++ gtk+-2.4.1/gtk/gtkcalendar.c 2004-05-26 14:58:57.000000000 +1000 | ||
53 | @@ -340,6 +340,9 @@ | ||
54 | static void gtk_calendar_select_and_focus_day (GtkCalendar *calendar, | ||
55 | guint day); | ||
56 | |||
57 | +static void gtk_calendar_do_select_day (GtkCalendar *calendar, | ||
58 | + guint day); | ||
59 | + | ||
60 | static void gtk_calendar_paint_arrow (GtkWidget *widget, | ||
61 | guint arrow); | ||
62 | static void gtk_calendar_paint_day_num (GtkWidget *widget, | ||
63 | @@ -861,13 +864,13 @@ | ||
64 | if (month_len < calendar->selected_day) | ||
65 | { | ||
66 | calendar->selected_day = 0; | ||
67 | - gtk_calendar_select_day (calendar, month_len); | ||
68 | + gtk_calendar_do_select_day (calendar, month_len); | ||
69 | } | ||
70 | else | ||
71 | { | ||
72 | if (calendar->selected_day < 0) | ||
73 | calendar->selected_day = calendar->selected_day + 1 + month_length[leap (calendar->year)][calendar->month + 1]; | ||
74 | - gtk_calendar_select_day (calendar, calendar->selected_day); | ||
75 | + gtk_calendar_do_select_day (calendar, calendar->selected_day); | ||
76 | } | ||
77 | |||
78 | gtk_widget_queue_draw (GTK_WIDGET (calendar)); | ||
79 | @@ -908,10 +911,10 @@ | ||
80 | if (month_len < calendar->selected_day) | ||
81 | { | ||
82 | calendar->selected_day = 0; | ||
83 | - gtk_calendar_select_day (calendar, month_len); | ||
84 | + gtk_calendar_do_select_day (calendar, month_len); | ||
85 | } | ||
86 | else | ||
87 | - gtk_calendar_select_day (calendar, calendar->selected_day); | ||
88 | + gtk_calendar_do_select_day (calendar, calendar->selected_day); | ||
89 | |||
90 | gtk_widget_queue_draw (GTK_WIDGET (calendar)); | ||
91 | gtk_calendar_thaw (calendar); | ||
92 | @@ -939,10 +942,10 @@ | ||
93 | if (month_len < calendar->selected_day) | ||
94 | { | ||
95 | calendar->selected_day = 0; | ||
96 | - gtk_calendar_select_day (calendar, month_len); | ||
97 | + gtk_calendar_do_select_day (calendar, month_len); | ||
98 | } | ||
99 | else | ||
100 | - gtk_calendar_select_day (calendar, calendar->selected_day); | ||
101 | + gtk_calendar_do_select_day (calendar, calendar->selected_day); | ||
102 | |||
103 | gtk_widget_queue_draw (GTK_WIDGET (calendar)); | ||
104 | gtk_calendar_thaw (calendar); | ||
105 | @@ -974,10 +977,10 @@ | ||
106 | if (month_len < calendar->selected_day) | ||
107 | { | ||
108 | calendar->selected_day = 0; | ||
109 | - gtk_calendar_select_day (calendar, month_len); | ||
110 | + gtk_calendar_do_select_day (calendar, month_len); | ||
111 | } | ||
112 | else | ||
113 | - gtk_calendar_select_day (calendar, calendar->selected_day); | ||
114 | + gtk_calendar_do_select_day (calendar, calendar->selected_day); | ||
115 | |||
116 | gtk_widget_queue_draw (GTK_WIDGET (calendar)); | ||
117 | gtk_calendar_thaw (calendar); | ||
118 | @@ -2480,9 +2483,9 @@ | ||
119 | return TRUE; | ||
120 | } | ||
121 | |||
122 | -void | ||
123 | -gtk_calendar_select_day (GtkCalendar *calendar, | ||
124 | - guint day) | ||
125 | +static void | ||
126 | +gtk_calendar_do_select_day (GtkCalendar *calendar, | ||
127 | + guint day) | ||
128 | { | ||
129 | g_return_if_fail (GTK_IS_CALENDAR (calendar)); | ||
130 | g_return_if_fail (day <= 31); | ||
131 | @@ -2499,6 +2502,13 @@ | ||
132 | if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar))) | ||
133 | gtk_calendar_paint_day_num (GTK_WIDGET (calendar), selected_day); | ||
134 | } | ||
135 | +} | ||
136 | + | ||
137 | +void | ||
138 | +gtk_calendar_select_day (GtkCalendar *calendar, | ||
139 | + guint day) | ||
140 | +{ | ||
141 | + gtk_calendar_do_select_day (calendar, day); | ||
142 | |||
143 | calendar->selected_day = day; | ||
144 | |||
145 | --- gtk+-2.4.1/gtk/gtkentry.c 2004-04-22 08:08:08.000000000 +1000 | ||
146 | +++ gtk+-2.4.1/gtk/gtkentry.c 2004-05-26 14:52:17.000000000 +1000 | ||
147 | @@ -557,6 +557,15 @@ | ||
148 | 0.0, | ||
149 | G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
150 | |||
151 | + gtk_widget_class_install_style_property (widget_class, | ||
152 | + g_param_spec_int ("min_width", | ||
153 | + _("Minimum width"), | ||
154 | + _("Minimum width of the entry field"), | ||
155 | + 0, | ||
156 | + G_MAXINT, | ||
157 | + MIN_ENTRY_WIDTH, | ||
158 | + G_PARAM_READABLE)); | ||
159 | + | ||
160 | signals[POPULATE_POPUP] = | ||
161 | g_signal_new ("populate_popup", | ||
162 | G_OBJECT_CLASS_TYPE (gobject_class), | ||
163 | @@ -1124,7 +1133,7 @@ | ||
164 | { | ||
165 | GtkEntry *entry = GTK_ENTRY (widget); | ||
166 | PangoFontMetrics *metrics; | ||
167 | - gint xborder, yborder; | ||
168 | + gint xborder, yborder, min_width; | ||
169 | PangoContext *context; | ||
170 | |||
171 | gtk_widget_ensure_style (widget); | ||
172 | @@ -1140,9 +1149,11 @@ | ||
173 | |||
174 | xborder += INNER_BORDER; | ||
175 | yborder += INNER_BORDER; | ||
176 | - | ||
177 | + | ||
178 | + gtk_widget_style_get (widget, "min_width", &min_width, NULL); | ||
179 | + | ||
180 | if (entry->width_chars < 0) | ||
181 | - requisition->width = MIN_ENTRY_WIDTH + xborder * 2; | ||
182 | + requisition->width = min_width + xborder * 2; | ||
183 | else | ||
184 | { | ||
185 | gint char_width = pango_font_metrics_get_approximate_char_width (metrics); | ||
186 | --- gtk+-2.4.1/gtk/gtkrange.c 2004-03-06 14:38:08.000000000 +1100 | ||
187 | +++ gtk+-2.4.1/gtk/gtkrange.c 2004-05-26 14:52:17.000000000 +1000 | ||
188 | @@ -180,6 +180,7 @@ | ||
189 | static GtkWidgetClass *parent_class = NULL; | ||
190 | static guint signals[LAST_SIGNAL]; | ||
191 | |||
192 | +static GdkAtom recognize_protocols_atom, atom_atom; | ||
193 | |||
194 | GType | ||
195 | gtk_range_get_type (void) | ||
196 | @@ -220,6 +221,9 @@ | ||
197 | object_class = (GtkObjectClass*) class; | ||
198 | widget_class = (GtkWidgetClass*) class; | ||
199 | |||
200 | + recognize_protocols_atom = gdk_atom_intern ("RECOGNIZE_PROTOCOLS", FALSE); | ||
201 | + atom_atom = gdk_atom_intern ("ATOM", FALSE); | ||
202 | + | ||
203 | parent_class = g_type_class_peek_parent (class); | ||
204 | |||
205 | gobject_class->set_property = gtk_range_set_property; | ||
206 | @@ -815,6 +819,12 @@ | ||
207 | &attributes, attributes_mask); | ||
208 | gdk_window_set_user_data (range->event_window, range); | ||
209 | |||
210 | + gdk_property_change (range->event_window, | ||
211 | + recognize_protocols_atom, | ||
212 | + atom_atom, | ||
213 | + 32, GDK_PROP_MODE_REPLACE, | ||
214 | + NULL, 0); | ||
215 | + | ||
216 | widget->style = gtk_style_attach (widget->style, widget->window); | ||
217 | } | ||
218 | |||
219 | @@ -1186,7 +1196,7 @@ | ||
220 | |||
221 | /* ignore presses when we're already doing something else. */ | ||
222 | if (range->layout->grab_location != MOUSE_OUTSIDE) | ||
223 | - return FALSE; | ||
224 | + return TRUE; | ||
225 | |||
226 | range->layout->mouse_x = event->x; | ||
227 | range->layout->mouse_y = event->y; | ||
228 | @@ -1364,7 +1374,7 @@ | ||
229 | return TRUE; | ||
230 | } | ||
231 | |||
232 | - return FALSE; | ||
233 | + return TRUE; | ||
234 | } | ||
235 | |||
236 | /** | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk.h.diff deleted file mode 100644 index 090d0da0eb..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk.h.diff +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtk.h 2004-09-27 21:37:33.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtk.h 2005-04-06 16:19:35.812094096 +0300 | ||
3 | @@ -156,6 +156,7 @@ | ||
4 | #include <gtk/gtktearoffmenuitem.h> | ||
5 | #include <gtk/gtktext.h> | ||
6 | #include <gtk/gtktextbuffer.h> | ||
7 | +#include <gtk/gtktextbufferserialize.h> | ||
8 | #include <gtk/gtktextview.h> | ||
9 | #include <gtk/gtktipsquery.h> | ||
10 | #include <gtk/gtktoggleaction.h> | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk_Makefile.am.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk_Makefile.am.diff deleted file mode 100644 index 0672df19b0..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk_Makefile.am.diff +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/Makefile.am 2005-01-13 17:18:21.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/Makefile.am 2005-04-06 16:19:35.806095008 +0300 | ||
3 | @@ -246,6 +246,7 @@ | ||
4 | gtktearoffmenuitem.h \ | ||
5 | gtktext.h \ | ||
6 | gtktextbuffer.h \ | ||
7 | + gtktextbufferserialize.h\ | ||
8 | gtktextchild.h \ | ||
9 | gtktextdisplay.h \ | ||
10 | gtktextiter.h \ | ||
11 | @@ -387,6 +388,8 @@ | ||
12 | gtkframe.c \ | ||
13 | gtkgamma.c \ | ||
14 | gtkgc.c \ | ||
15 | + gtkhashtable.c \ | ||
16 | + gtkhashtable.h \ | ||
17 | gtkhandlebox.c \ | ||
18 | gtkhbbox.c \ | ||
19 | gtkhbox.c \ | ||
20 | @@ -470,6 +473,7 @@ | ||
21 | gtktext.c \ | ||
22 | gtktextbtree.c \ | ||
23 | gtktextbuffer.c \ | ||
24 | + gtktextbufferserialize.c\ | ||
25 | gtktextchild.c \ | ||
26 | gtktextdisplay.c \ | ||
27 | gtktextiter.c \ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk_Makefile.in.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk_Makefile.in.diff deleted file mode 100644 index 56eca02b03..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtk_Makefile.in.diff +++ /dev/null | |||
@@ -1,292 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/Makefile.in 2005-03-01 17:31:32.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/Makefile.in 2005-04-06 16:19:35.808094704 +0300 | ||
3 | @@ -485,6 +485,7 @@ | ||
4 | gtktearoffmenuitem.h \ | ||
5 | gtktext.h \ | ||
6 | gtktextbuffer.h \ | ||
7 | + gtktextbufferserialize.h\ | ||
8 | gtktextchild.h \ | ||
9 | gtktextdisplay.h \ | ||
10 | gtktextiter.h \ | ||
11 | @@ -629,6 +630,8 @@ | ||
12 | gtkframe.c \ | ||
13 | gtkgamma.c \ | ||
14 | gtkgc.c \ | ||
15 | + gtkhashtable.c \ | ||
16 | + gtkhashtable.h \ | ||
17 | gtkhandlebox.c \ | ||
18 | gtkhbbox.c \ | ||
19 | gtkhbox.c \ | ||
20 | @@ -712,6 +715,7 @@ | ||
21 | gtktext.c \ | ||
22 | gtktextbtree.c \ | ||
23 | gtktextbuffer.c \ | ||
24 | + gtktextbufferserialize.c\ | ||
25 | gtktextchild.c \ | ||
26 | gtktextdisplay.c \ | ||
27 | gtktextiter.c \ | ||
28 | @@ -927,14 +931,14 @@ | ||
29 | gtkfilechooserdefault.c gtkfilechooserutils.c \ | ||
30 | gtkfilechooserwidget.c gtkfilefilter.c gtkfilesel.c \ | ||
31 | gtkfilesystem.c gtkfilesystemmodel.c gtkfixed.c gtkfontbutton.c \ | ||
32 | - gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhandlebox.c \ | ||
33 | - gtkhbbox.c gtkhbox.c gtkhpaned.c gtkhruler.c gtkhscale.c \ | ||
34 | - gtkhscrollbar.c gtkhseparator.c gtkhsv.c gtkhsv.h \ | ||
35 | - gtkiconfactory.c gtkiconcache.c gtkicontheme.c gtkiconview.c \ | ||
36 | - gtkimage.c gtkimagemenuitem.c gtkimcontext.c \ | ||
37 | - gtkimcontextsimple.c gtkimmodule.c gtkimmulticontext.c \ | ||
38 | - gtkinputdialog.c gtkintl.h gtkinvisible.c gtkitem.c \ | ||
39 | - gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \ | ||
40 | + gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhashtable.c \ | ||
41 | + gtkhashtable.h gtkhandlebox.c gtkhbbox.c gtkhbox.c gtkhpaned.c \ | ||
42 | + gtkhruler.c gtkhscale.c gtkhscrollbar.c gtkhseparator.c \ | ||
43 | + gtkhsv.c gtkhsv.h gtkiconfactory.c gtkiconcache.c \ | ||
44 | + gtkicontheme.c gtkiconview.c gtkimage.c gtkimagemenuitem.c \ | ||
45 | + gtkimcontext.c gtkimcontextsimple.c gtkimmodule.c \ | ||
46 | + gtkimmulticontext.c gtkinputdialog.c gtkintl.h gtkinvisible.c \ | ||
47 | + gtkitem.c gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \ | ||
48 | gtklayout.c gtklist.c gtklistitem.c gtkliststore.c gtkmain.c \ | ||
49 | gtkmarshal.c gtkmarshalers.c gtkmenu.c gtkmenubar.c \ | ||
50 | gtkmenuitem.c gtkmenushell.c gtkmenutoolbutton.c \ | ||
51 | @@ -949,21 +953,21 @@ | ||
52 | gtkseparatortoolitem.c gtksettings.c gtksignal.c gtksizegroup.c \ | ||
53 | gtkspinbutton.c gtkstatusbar.c gtkstock.c gtkstyle.c gtktable.c \ | ||
54 | gtktearoffmenuitem.c gtktext.c gtktextbtree.c gtktextbuffer.c \ | ||
55 | - gtktextchild.c gtktextdisplay.c gtktextiter.c \ | ||
56 | - gtktextiterprivate.h gtktextlayout.c gtktextmark.c \ | ||
57 | - gtktextmarkprivate.h gtktextsegment.c gtktexttag.c \ | ||
58 | - gtktexttagtable.c gtktexttypes.c gtktextutil.c gtktextview.c \ | ||
59 | - gtkthemes.c gtktipsquery.c gtktoggleaction.c gtktogglebutton.c \ | ||
60 | - gtktoggletoolbutton.c gtktoolbar.c gtktoolbutton.c \ | ||
61 | - gtktoolitem.c gtktooltips.c gtktree.c gtktreedatalist.c \ | ||
62 | - gtktreednd.c gtktreeitem.c gtktreemodel.c gtktreemodelfilter.c \ | ||
63 | - gtktreemodelsort.c gtktreeselection.c gtktreesortable.c \ | ||
64 | - gtktreestore.c gtktreeview.c gtktreeviewcolumn.c \ | ||
65 | - gtktypebuiltins.c gtktypeutils.c gtkuimanager.c gtkvbbox.c \ | ||
66 | - gtkvbox.c gtkviewport.c gtkvpaned.c gtkvruler.c gtkvscale.c \ | ||
67 | - gtkvscrollbar.c gtkvseparator.c gtkwidget.c \ | ||
68 | - gtkwindow-decorate.c gtkwindow.c xembed.h gtkfilesystemunix.c \ | ||
69 | - gtkfilesystemwin32.c | ||
70 | + gtktextbufferserialize.c gtktextchild.c gtktextdisplay.c \ | ||
71 | + gtktextiter.c gtktextiterprivate.h gtktextlayout.c \ | ||
72 | + gtktextmark.c gtktextmarkprivate.h gtktextsegment.c \ | ||
73 | + gtktexttag.c gtktexttagtable.c gtktexttypes.c gtktextutil.c \ | ||
74 | + gtktextview.c gtkthemes.c gtktipsquery.c gtktoggleaction.c \ | ||
75 | + gtktogglebutton.c gtktoggletoolbutton.c gtktoolbar.c \ | ||
76 | + gtktoolbutton.c gtktoolitem.c gtktooltips.c gtktree.c \ | ||
77 | + gtktreedatalist.c gtktreednd.c gtktreeitem.c gtktreemodel.c \ | ||
78 | + gtktreemodelfilter.c gtktreemodelsort.c gtktreeselection.c \ | ||
79 | + gtktreesortable.c gtktreestore.c gtktreeview.c \ | ||
80 | + gtktreeviewcolumn.c gtktypebuiltins.c gtktypeutils.c \ | ||
81 | + gtkuimanager.c gtkvbbox.c gtkvbox.c gtkviewport.c gtkvpaned.c \ | ||
82 | + gtkvruler.c gtkvscale.c gtkvscrollbar.c gtkvseparator.c \ | ||
83 | + gtkwidget.c gtkwindow-decorate.c gtkwindow.c xembed.h \ | ||
84 | + gtkfilesystemunix.c gtkfilesystemwin32.c | ||
85 | @OS_UNIX_TRUE@am__objects_1 = gtkfilesystemunix.lo | ||
86 | @OS_WIN32_TRUE@am__objects_2 = gtkfilesystemwin32.lo | ||
87 | am__objects_3 = fnmatch.lo gtkaboutdialog.lo gtkaccelgroup.lo \ | ||
88 | @@ -986,16 +990,16 @@ | ||
89 | gtkfilechooserutils.lo gtkfilechooserwidget.lo gtkfilefilter.lo \ | ||
90 | gtkfilesel.lo gtkfilesystem.lo gtkfilesystemmodel.lo \ | ||
91 | gtkfixed.lo gtkfontbutton.lo gtkfontsel.lo gtkframe.lo \ | ||
92 | - gtkgamma.lo gtkgc.lo gtkhandlebox.lo gtkhbbox.lo gtkhbox.lo \ | ||
93 | - gtkhpaned.lo gtkhruler.lo gtkhscale.lo gtkhscrollbar.lo \ | ||
94 | - gtkhseparator.lo gtkhsv.lo gtkiconfactory.lo gtkiconcache.lo \ | ||
95 | - gtkicontheme.lo gtkiconview.lo gtkimage.lo gtkimagemenuitem.lo \ | ||
96 | - gtkimcontext.lo gtkimcontextsimple.lo gtkimmodule.lo \ | ||
97 | - gtkimmulticontext.lo gtkinputdialog.lo gtkinvisible.lo \ | ||
98 | - gtkitem.lo gtkitemfactory.lo gtkkeyhash.lo gtklabel.lo \ | ||
99 | - gtklayout.lo gtklist.lo gtklistitem.lo gtkliststore.lo \ | ||
100 | - gtkmain.lo gtkmarshal.lo gtkmarshalers.lo gtkmenu.lo \ | ||
101 | - gtkmenubar.lo gtkmenuitem.lo gtkmenushell.lo \ | ||
102 | + gtkgamma.lo gtkgc.lo gtkhashtable.lo gtkhandlebox.lo \ | ||
103 | + gtkhbbox.lo gtkhbox.lo gtkhpaned.lo gtkhruler.lo gtkhscale.lo \ | ||
104 | + gtkhscrollbar.lo gtkhseparator.lo gtkhsv.lo gtkiconfactory.lo \ | ||
105 | + gtkiconcache.lo gtkicontheme.lo gtkiconview.lo gtkimage.lo \ | ||
106 | + gtkimagemenuitem.lo gtkimcontext.lo gtkimcontextsimple.lo \ | ||
107 | + gtkimmodule.lo gtkimmulticontext.lo gtkinputdialog.lo \ | ||
108 | + gtkinvisible.lo gtkitem.lo gtkitemfactory.lo gtkkeyhash.lo \ | ||
109 | + gtklabel.lo gtklayout.lo gtklist.lo gtklistitem.lo \ | ||
110 | + gtkliststore.lo gtkmain.lo gtkmarshal.lo gtkmarshalers.lo \ | ||
111 | + gtkmenu.lo gtkmenubar.lo gtkmenuitem.lo gtkmenushell.lo \ | ||
112 | gtkmenutoolbutton.lo gtkmessagedialog.lo gtkmisc.lo \ | ||
113 | gtkmnemonichash.lo gtkmodules.lo gtknotebook.lo gtkobject.lo \ | ||
114 | gtkoldeditable.lo gtkoptionmenu.lo gtkpaned.lo gtkpathbar.lo \ | ||
115 | @@ -1007,14 +1011,15 @@ | ||
116 | gtkseparatormenuitem.lo gtkseparatortoolitem.lo gtksettings.lo \ | ||
117 | gtksignal.lo gtksizegroup.lo gtkspinbutton.lo gtkstatusbar.lo \ | ||
118 | gtkstock.lo gtkstyle.lo gtktable.lo gtktearoffmenuitem.lo \ | ||
119 | - gtktext.lo gtktextbtree.lo gtktextbuffer.lo gtktextchild.lo \ | ||
120 | - gtktextdisplay.lo gtktextiter.lo gtktextlayout.lo \ | ||
121 | - gtktextmark.lo gtktextsegment.lo gtktexttag.lo \ | ||
122 | - gtktexttagtable.lo gtktexttypes.lo gtktextutil.lo \ | ||
123 | - gtktextview.lo gtkthemes.lo gtktipsquery.lo gtktoggleaction.lo \ | ||
124 | - gtktogglebutton.lo gtktoggletoolbutton.lo gtktoolbar.lo \ | ||
125 | - gtktoolbutton.lo gtktoolitem.lo gtktooltips.lo gtktree.lo \ | ||
126 | - gtktreedatalist.lo gtktreednd.lo gtktreeitem.lo gtktreemodel.lo \ | ||
127 | + gtktext.lo gtktextbtree.lo gtktextbuffer.lo \ | ||
128 | + gtktextbufferserialize.lo gtktextchild.lo gtktextdisplay.lo \ | ||
129 | + gtktextiter.lo gtktextlayout.lo gtktextmark.lo \ | ||
130 | + gtktextsegment.lo gtktexttag.lo gtktexttagtable.lo \ | ||
131 | + gtktexttypes.lo gtktextutil.lo gtktextview.lo gtkthemes.lo \ | ||
132 | + gtktipsquery.lo gtktoggleaction.lo gtktogglebutton.lo \ | ||
133 | + gtktoggletoolbutton.lo gtktoolbar.lo gtktoolbutton.lo \ | ||
134 | + gtktoolitem.lo gtktooltips.lo gtktree.lo gtktreedatalist.lo \ | ||
135 | + gtktreednd.lo gtktreeitem.lo gtktreemodel.lo \ | ||
136 | gtktreemodelfilter.lo gtktreemodelsort.lo gtktreeselection.lo \ | ||
137 | gtktreesortable.lo gtktreestore.lo gtktreeview.lo \ | ||
138 | gtktreeviewcolumn.lo gtktypebuiltins.lo gtktypeutils.lo \ | ||
139 | @@ -1042,14 +1047,14 @@ | ||
140 | gtkfilechooserdefault.c gtkfilechooserutils.c \ | ||
141 | gtkfilechooserwidget.c gtkfilefilter.c gtkfilesel.c \ | ||
142 | gtkfilesystem.c gtkfilesystemmodel.c gtkfixed.c gtkfontbutton.c \ | ||
143 | - gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhandlebox.c \ | ||
144 | - gtkhbbox.c gtkhbox.c gtkhpaned.c gtkhruler.c gtkhscale.c \ | ||
145 | - gtkhscrollbar.c gtkhseparator.c gtkhsv.c gtkhsv.h \ | ||
146 | - gtkiconfactory.c gtkiconcache.c gtkicontheme.c gtkiconview.c \ | ||
147 | - gtkimage.c gtkimagemenuitem.c gtkimcontext.c \ | ||
148 | - gtkimcontextsimple.c gtkimmodule.c gtkimmulticontext.c \ | ||
149 | - gtkinputdialog.c gtkintl.h gtkinvisible.c gtkitem.c \ | ||
150 | - gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \ | ||
151 | + gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhashtable.c \ | ||
152 | + gtkhashtable.h gtkhandlebox.c gtkhbbox.c gtkhbox.c gtkhpaned.c \ | ||
153 | + gtkhruler.c gtkhscale.c gtkhscrollbar.c gtkhseparator.c \ | ||
154 | + gtkhsv.c gtkhsv.h gtkiconfactory.c gtkiconcache.c \ | ||
155 | + gtkicontheme.c gtkiconview.c gtkimage.c gtkimagemenuitem.c \ | ||
156 | + gtkimcontext.c gtkimcontextsimple.c gtkimmodule.c \ | ||
157 | + gtkimmulticontext.c gtkinputdialog.c gtkintl.h gtkinvisible.c \ | ||
158 | + gtkitem.c gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \ | ||
159 | gtklayout.c gtklist.c gtklistitem.c gtkliststore.c gtkmain.c \ | ||
160 | gtkmarshal.c gtkmarshalers.c gtkmenu.c gtkmenubar.c \ | ||
161 | gtkmenuitem.c gtkmenushell.c gtkmenutoolbutton.c \ | ||
162 | @@ -1064,21 +1069,21 @@ | ||
163 | gtkseparatortoolitem.c gtksettings.c gtksignal.c gtksizegroup.c \ | ||
164 | gtkspinbutton.c gtkstatusbar.c gtkstock.c gtkstyle.c gtktable.c \ | ||
165 | gtktearoffmenuitem.c gtktext.c gtktextbtree.c gtktextbuffer.c \ | ||
166 | - gtktextchild.c gtktextdisplay.c gtktextiter.c \ | ||
167 | - gtktextiterprivate.h gtktextlayout.c gtktextmark.c \ | ||
168 | - gtktextmarkprivate.h gtktextsegment.c gtktexttag.c \ | ||
169 | - gtktexttagtable.c gtktexttypes.c gtktextutil.c gtktextview.c \ | ||
170 | - gtkthemes.c gtktipsquery.c gtktoggleaction.c gtktogglebutton.c \ | ||
171 | - gtktoggletoolbutton.c gtktoolbar.c gtktoolbutton.c \ | ||
172 | - gtktoolitem.c gtktooltips.c gtktree.c gtktreedatalist.c \ | ||
173 | - gtktreednd.c gtktreeitem.c gtktreemodel.c gtktreemodelfilter.c \ | ||
174 | - gtktreemodelsort.c gtktreeselection.c gtktreesortable.c \ | ||
175 | - gtktreestore.c gtktreeview.c gtktreeviewcolumn.c \ | ||
176 | - gtktypebuiltins.c gtktypeutils.c gtkuimanager.c gtkvbbox.c \ | ||
177 | - gtkvbox.c gtkviewport.c gtkvpaned.c gtkvruler.c gtkvscale.c \ | ||
178 | - gtkvscrollbar.c gtkvseparator.c gtkwidget.c \ | ||
179 | - gtkwindow-decorate.c gtkwindow.c xembed.h gtkfilesystemunix.c \ | ||
180 | - gtkfilesystemwin32.c | ||
181 | + gtktextbufferserialize.c gtktextchild.c gtktextdisplay.c \ | ||
182 | + gtktextiter.c gtktextiterprivate.h gtktextlayout.c \ | ||
183 | + gtktextmark.c gtktextmarkprivate.h gtktextsegment.c \ | ||
184 | + gtktexttag.c gtktexttagtable.c gtktexttypes.c gtktextutil.c \ | ||
185 | + gtktextview.c gtkthemes.c gtktipsquery.c gtktoggleaction.c \ | ||
186 | + gtktogglebutton.c gtktoggletoolbutton.c gtktoolbar.c \ | ||
187 | + gtktoolbutton.c gtktoolitem.c gtktooltips.c gtktree.c \ | ||
188 | + gtktreedatalist.c gtktreednd.c gtktreeitem.c gtktreemodel.c \ | ||
189 | + gtktreemodelfilter.c gtktreemodelsort.c gtktreeselection.c \ | ||
190 | + gtktreesortable.c gtktreestore.c gtktreeview.c \ | ||
191 | + gtktreeviewcolumn.c gtktypebuiltins.c gtktypeutils.c \ | ||
192 | + gtkuimanager.c gtkvbbox.c gtkvbox.c gtkviewport.c gtkvpaned.c \ | ||
193 | + gtkvruler.c gtkvscale.c gtkvscrollbar.c gtkvseparator.c \ | ||
194 | + gtkwidget.c gtkwindow-decorate.c gtkwindow.c xembed.h \ | ||
195 | + gtkfilesystemunix.c gtkfilesystemwin32.c | ||
196 | am_libgtk_win32_2_0_la_OBJECTS = $(am__objects_3) | ||
197 | libgtk_win32_2_0_la_OBJECTS = $(am_libgtk_win32_2_0_la_OBJECTS) | ||
198 | @OS_UNIX_TRUE@libgtk_x11_2_0_la_DEPENDENCIES = \ | ||
199 | @@ -1106,14 +1111,14 @@ | ||
200 | gtkfilechooserdefault.c gtkfilechooserutils.c \ | ||
201 | gtkfilechooserwidget.c gtkfilefilter.c gtkfilesel.c \ | ||
202 | gtkfilesystem.c gtkfilesystemmodel.c gtkfixed.c gtkfontbutton.c \ | ||
203 | - gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhandlebox.c \ | ||
204 | - gtkhbbox.c gtkhbox.c gtkhpaned.c gtkhruler.c gtkhscale.c \ | ||
205 | - gtkhscrollbar.c gtkhseparator.c gtkhsv.c gtkhsv.h \ | ||
206 | - gtkiconfactory.c gtkiconcache.c gtkicontheme.c gtkiconview.c \ | ||
207 | - gtkimage.c gtkimagemenuitem.c gtkimcontext.c \ | ||
208 | - gtkimcontextsimple.c gtkimmodule.c gtkimmulticontext.c \ | ||
209 | - gtkinputdialog.c gtkintl.h gtkinvisible.c gtkitem.c \ | ||
210 | - gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \ | ||
211 | + gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhashtable.c \ | ||
212 | + gtkhashtable.h gtkhandlebox.c gtkhbbox.c gtkhbox.c gtkhpaned.c \ | ||
213 | + gtkhruler.c gtkhscale.c gtkhscrollbar.c gtkhseparator.c \ | ||
214 | + gtkhsv.c gtkhsv.h gtkiconfactory.c gtkiconcache.c \ | ||
215 | + gtkicontheme.c gtkiconview.c gtkimage.c gtkimagemenuitem.c \ | ||
216 | + gtkimcontext.c gtkimcontextsimple.c gtkimmodule.c \ | ||
217 | + gtkimmulticontext.c gtkinputdialog.c gtkintl.h gtkinvisible.c \ | ||
218 | + gtkitem.c gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \ | ||
219 | gtklayout.c gtklist.c gtklistitem.c gtkliststore.c gtkmain.c \ | ||
220 | gtkmarshal.c gtkmarshalers.c gtkmenu.c gtkmenubar.c \ | ||
221 | gtkmenuitem.c gtkmenushell.c gtkmenutoolbutton.c \ | ||
222 | @@ -1128,22 +1133,22 @@ | ||
223 | gtkseparatortoolitem.c gtksettings.c gtksignal.c gtksizegroup.c \ | ||
224 | gtkspinbutton.c gtkstatusbar.c gtkstock.c gtkstyle.c gtktable.c \ | ||
225 | gtktearoffmenuitem.c gtktext.c gtktextbtree.c gtktextbuffer.c \ | ||
226 | - gtktextchild.c gtktextdisplay.c gtktextiter.c \ | ||
227 | - gtktextiterprivate.h gtktextlayout.c gtktextmark.c \ | ||
228 | - gtktextmarkprivate.h gtktextsegment.c gtktexttag.c \ | ||
229 | - gtktexttagtable.c gtktexttypes.c gtktextutil.c gtktextview.c \ | ||
230 | - gtkthemes.c gtktipsquery.c gtktoggleaction.c gtktogglebutton.c \ | ||
231 | - gtktoggletoolbutton.c gtktoolbar.c gtktoolbutton.c \ | ||
232 | - gtktoolitem.c gtktooltips.c gtktree.c gtktreedatalist.c \ | ||
233 | - gtktreednd.c gtktreeitem.c gtktreemodel.c gtktreemodelfilter.c \ | ||
234 | - gtktreemodelsort.c gtktreeselection.c gtktreesortable.c \ | ||
235 | - gtktreestore.c gtktreeview.c gtktreeviewcolumn.c \ | ||
236 | - gtktypebuiltins.c gtktypeutils.c gtkuimanager.c gtkvbbox.c \ | ||
237 | - gtkvbox.c gtkviewport.c gtkvpaned.c gtkvruler.c gtkvscale.c \ | ||
238 | - gtkvscrollbar.c gtkvseparator.c gtkwidget.c \ | ||
239 | - gtkwindow-decorate.c gtkwindow.c xembed.h gtkfilesystemunix.c \ | ||
240 | - gtkfilesystemwin32.c gtkplug.c gtksocket.c gtkxembed.c \ | ||
241 | - gtkxembed.h | ||
242 | + gtktextbufferserialize.c gtktextchild.c gtktextdisplay.c \ | ||
243 | + gtktextiter.c gtktextiterprivate.h gtktextlayout.c \ | ||
244 | + gtktextmark.c gtktextmarkprivate.h gtktextsegment.c \ | ||
245 | + gtktexttag.c gtktexttagtable.c gtktexttypes.c gtktextutil.c \ | ||
246 | + gtktextview.c gtkthemes.c gtktipsquery.c gtktoggleaction.c \ | ||
247 | + gtktogglebutton.c gtktoggletoolbutton.c gtktoolbar.c \ | ||
248 | + gtktoolbutton.c gtktoolitem.c gtktooltips.c gtktree.c \ | ||
249 | + gtktreedatalist.c gtktreednd.c gtktreeitem.c gtktreemodel.c \ | ||
250 | + gtktreemodelfilter.c gtktreemodelsort.c gtktreeselection.c \ | ||
251 | + gtktreesortable.c gtktreestore.c gtktreeview.c \ | ||
252 | + gtktreeviewcolumn.c gtktypebuiltins.c gtktypeutils.c \ | ||
253 | + gtkuimanager.c gtkvbbox.c gtkvbox.c gtkviewport.c gtkvpaned.c \ | ||
254 | + gtkvruler.c gtkvscale.c gtkvscrollbar.c gtkvseparator.c \ | ||
255 | + gtkwidget.c gtkwindow-decorate.c gtkwindow.c xembed.h \ | ||
256 | + gtkfilesystemunix.c gtkfilesystemwin32.c gtkplug.c gtksocket.c \ | ||
257 | + gtkxembed.c gtkxembed.h | ||
258 | am__objects_4 = gtkplug.lo gtksocket.lo gtkxembed.lo | ||
259 | am_libgtk_x11_2_0_la_OBJECTS = $(am__objects_3) $(am__objects_4) | ||
260 | libgtk_x11_2_0_la_OBJECTS = $(am_libgtk_x11_2_0_la_OBJECTS) | ||
261 | @@ -1224,6 +1229,7 @@ | ||
262 | @AMDEP_TRUE@ ./$(DEPDIR)/gtkfontsel.Plo ./$(DEPDIR)/gtkframe.Plo \ | ||
263 | @AMDEP_TRUE@ ./$(DEPDIR)/gtkgamma.Plo ./$(DEPDIR)/gtkgc.Plo \ | ||
264 | @AMDEP_TRUE@ ./$(DEPDIR)/gtkhandlebox.Plo \ | ||
265 | +@AMDEP_TRUE@ ./$(DEPDIR)/gtkhashtable.Plo \ | ||
266 | @AMDEP_TRUE@ ./$(DEPDIR)/gtkhbbox.Plo ./$(DEPDIR)/gtkhbox.Plo \ | ||
267 | @AMDEP_TRUE@ ./$(DEPDIR)/gtkhpaned.Plo ./$(DEPDIR)/gtkhruler.Plo \ | ||
268 | @AMDEP_TRUE@ ./$(DEPDIR)/gtkhscale.Plo \ | ||
269 | @@ -1292,6 +1298,7 @@ | ||
270 | @AMDEP_TRUE@ ./$(DEPDIR)/gtktext.Plo \ | ||
271 | @AMDEP_TRUE@ ./$(DEPDIR)/gtktextbtree.Plo \ | ||
272 | @AMDEP_TRUE@ ./$(DEPDIR)/gtktextbuffer.Plo \ | ||
273 | +@AMDEP_TRUE@ ./$(DEPDIR)/gtktextbufferserialize.Plo \ | ||
274 | @AMDEP_TRUE@ ./$(DEPDIR)/gtktextchild.Plo \ | ||
275 | @AMDEP_TRUE@ ./$(DEPDIR)/gtktextdisplay.Plo \ | ||
276 | @AMDEP_TRUE@ ./$(DEPDIR)/gtktextiter.Plo \ | ||
277 | @@ -1524,6 +1531,7 @@ | ||
278 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkgamma.Plo@am__quote@ | ||
279 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkgc.Plo@am__quote@ | ||
280 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhandlebox.Plo@am__quote@ | ||
281 | +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhashtable.Plo@am__quote@ | ||
282 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhbbox.Plo@am__quote@ | ||
283 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhbox.Plo@am__quote@ | ||
284 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhpaned.Plo@am__quote@ | ||
285 | @@ -1604,6 +1612,7 @@ | ||
286 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktext.Plo@am__quote@ | ||
287 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextbtree.Plo@am__quote@ | ||
288 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextbuffer.Plo@am__quote@ | ||
289 | +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextbufferserialize.Plo@am__quote@ | ||
290 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextchild.Plo@am__quote@ | ||
291 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextdisplay.Plo@am__quote@ | ||
292 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextiter.Plo@am__quote@ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkalias.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkalias.h.diff deleted file mode 100644 index 8c87424ce8..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkalias.h.diff +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkalias.h 2005-03-01 17:58:16.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkalias.h 2005-04-06 16:19:36.020062480 +0300 | ||
3 | @@ -5782,6 +5782,14 @@ | ||
4 | extern __typeof (gtk_menu_shell_select_item) gtk_menu_shell_select_item __attribute((alias("IA__gtk_menu_shell_select_item"), visibility("default"))); | ||
5 | #define gtk_menu_shell_select_item IA__gtk_menu_shell_select_item | ||
6 | |||
7 | +extern __typeof (gtk_menu_shell_set_take_focus) IA__gtk_menu_shell_set_take_focus __attribute((visibility("hidden"))); | ||
8 | +extern __typeof (gtk_menu_shell_set_take_focus) gtk_menu_shell_set_take_focus __attribute((alias("IA__gtk_menu_shell_set_take_focus"), visibility("default"))); | ||
9 | +#define gtk_menu_shell_set_take_focus IA__gtk_menu_shell_set_take_focus | ||
10 | + | ||
11 | +extern __typeof (gtk_menu_shell_get_take_focus) IA__gtk_menu_shell_get_take_focus __attribute((visibility("hidden"))); | ||
12 | +extern __typeof (gtk_menu_shell_get_take_focus) gtk_menu_shell_get_take_focus __attribute((alias("IA__gtk_menu_shell_get_take_focus"), visibility("default"))); | ||
13 | +#define gtk_menu_shell_get_take_focus IA__gtk_menu_shell_get_take_focus | ||
14 | + | ||
15 | extern __typeof (gtk_menu_tool_button_get_menu) IA__gtk_menu_tool_button_get_menu __attribute((visibility("hidden"))); | ||
16 | extern __typeof (gtk_menu_tool_button_get_menu) gtk_menu_tool_button_get_menu __attribute((alias("IA__gtk_menu_tool_button_get_menu"), visibility("default"))); | ||
17 | #define gtk_menu_tool_button_get_menu IA__gtk_menu_tool_button_get_menu | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkbutton.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkbutton.c.diff deleted file mode 100644 index e5a007372a..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkbutton.c.diff +++ /dev/null | |||
@@ -1,471 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkbutton.c 2005-01-25 22:54:43.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkbutton.c 2005-04-06 16:19:36.249027672 +0300 | ||
3 | @@ -24,6 +24,10 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | #include <config.h> | ||
12 | #include <string.h> | ||
13 | #include "gtkalias.h" | ||
14 | @@ -38,8 +42,33 @@ | ||
15 | #include "gtkiconfactory.h" | ||
16 | #include "gtkintl.h" | ||
17 | |||
18 | +/* Osso addition: | ||
19 | + * Here are the details for each attach | ||
20 | + * bitmask combination. */ | ||
21 | +const gchar *osso_gtk_button_attach_details [OSSO_GTK_BUTTON_ATTACH_ENUM_END] = | ||
22 | + { "osso_button", | ||
23 | + "osso_button_n", | ||
24 | + "osso_button_e", | ||
25 | + "osso_button_ne", | ||
26 | + "osso_button_s", | ||
27 | + "osso_button_ns", | ||
28 | + "osso_button_es", | ||
29 | + "osso_button_nes", | ||
30 | + "osso_button_w", | ||
31 | + "osso_button_nw", | ||
32 | + "osso_button_ew", | ||
33 | + "osso_button_new", | ||
34 | + "osso_button_sw", | ||
35 | + "osso_button_nsw", | ||
36 | + "osso_button_esw", | ||
37 | + "osso_button_nesw", | ||
38 | + }; | ||
39 | + | ||
40 | #define CHILD_SPACING 1 | ||
41 | |||
42 | +/* Take this away after font drawing is fixed */ | ||
43 | +#define OSSO_FONT_HACK TRUE | ||
44 | + | ||
45 | static const GtkBorder default_default_border = { 1, 1, 1, 1 }; | ||
46 | static const GtkBorder default_default_outside_border = { 0, 0, 0, 0 }; | ||
47 | |||
48 | @@ -68,6 +97,9 @@ | ||
49 | PROP_FOCUS_ON_CLICK, | ||
50 | PROP_XALIGN, | ||
51 | PROP_YALIGN, | ||
52 | + PROP_DETAIL, | ||
53 | + PROP_AUTOMATIC_DETAIL, | ||
54 | + PROP_KEYBOARD_BUTTON | ||
55 | }; | ||
56 | |||
57 | #define GTK_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_BUTTON, GtkButtonPrivate)) | ||
58 | @@ -80,6 +112,10 @@ | ||
59 | GtkWidget *image; | ||
60 | guint align_set : 1; | ||
61 | guint image_is_stock : 1; | ||
62 | + gchar *detail; | ||
63 | + gboolean automatic_detail; | ||
64 | + gboolean keyboard_button; | ||
65 | + GtkLabel *keyboard_label; | ||
66 | }; | ||
67 | |||
68 | static void gtk_button_class_init (GtkButtonClass *klass); | ||
69 | @@ -231,6 +267,14 @@ | ||
70 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); | ||
71 | |||
72 | g_object_class_install_property (gobject_class, | ||
73 | + PROP_KEYBOARD_BUTTON, | ||
74 | + g_param_spec_boolean ("keyboard_button", | ||
75 | + P_("Keyboard button"), | ||
76 | + P_("If set, label foo"), | ||
77 | + FALSE, | ||
78 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); | ||
79 | + | ||
80 | + g_object_class_install_property (gobject_class, | ||
81 | PROP_USE_STOCK, | ||
82 | g_param_spec_boolean ("use_stock", | ||
83 | P_("Use stock"), | ||
84 | @@ -418,6 +462,77 @@ | ||
85 | P_("Whether stock icons should be shown in buttons"), | ||
86 | TRUE, | ||
87 | G_PARAM_READWRITE)); | ||
88 | + | ||
89 | + gtk_widget_class_install_style_property (widget_class, | ||
90 | + g_param_spec_int ("child_spacing", | ||
91 | + _("Child spacing"), | ||
92 | + _("Spacing between button edges and child."), | ||
93 | + 0, | ||
94 | + G_MAXINT, | ||
95 | + CHILD_SPACING, | ||
96 | + G_PARAM_READABLE)); | ||
97 | + /* Osso additions below */ | ||
98 | + g_object_class_install_property (gobject_class, | ||
99 | + PROP_DETAIL, | ||
100 | + g_param_spec_string ("detail", | ||
101 | + P_("Detail"), | ||
102 | + P_("The detail the button is drawn with."), | ||
103 | + "buttondefault", | ||
104 | + G_PARAM_READWRITE)); | ||
105 | + | ||
106 | + g_object_class_install_property (gobject_class, | ||
107 | + PROP_AUTOMATIC_DETAIL, | ||
108 | + g_param_spec_boolean ("automatic_detail", | ||
109 | + P_("Automatic Detail"), | ||
110 | + P_("Whether setting detail is automatic based on GtkTable/GtkHButtonBox."), | ||
111 | + TRUE, | ||
112 | + G_PARAM_READWRITE)); | ||
113 | + | ||
114 | + | ||
115 | + gtk_widget_class_install_style_property (widget_class, | ||
116 | + g_param_spec_int ("child_offset_y", | ||
117 | + _("Child Y Offset"), | ||
118 | + _("Enable hack how many pixels to add/take away from GtkButton's child size allocation."), | ||
119 | + G_MININT, | ||
120 | + G_MAXINT, | ||
121 | + 0, | ||
122 | + G_PARAM_READABLE)); | ||
123 | + | ||
124 | + /* OSSO: This is used to find out whether | ||
125 | + * button is a GtkTreeView column Listbox | ||
126 | + * header or not */ | ||
127 | + gtk_widget_class_install_style_property (widget_class, | ||
128 | + g_param_spec_boolean ("listboxheader", | ||
129 | + P_( "Listbox header" ), | ||
130 | + P_( "Listbox header ( FALSE / TRUE )" ), | ||
131 | + FALSE, | ||
132 | + G_PARAM_READABLE)); | ||
133 | + | ||
134 | + /* OSSO: Column Listbox header separator height */ | ||
135 | + gtk_widget_class_install_style_property (widget_class, | ||
136 | + g_param_spec_int ("separator-height", | ||
137 | + P_( "Separator height" ), | ||
138 | + P_( "Listbox header separator height ( FALSE / TRUE )" ), | ||
139 | + 0, | ||
140 | + G_MAXINT, | ||
141 | + 0, | ||
142 | + G_PARAM_READABLE)); | ||
143 | + | ||
144 | + gtk_widget_class_install_style_property (widget_class, | ||
145 | + g_param_spec_boxed ("padding", | ||
146 | + P_("Padding"), | ||
147 | + P_("Paddings around the button child"), | ||
148 | + GTK_TYPE_BORDER, | ||
149 | + G_PARAM_READABLE)); | ||
150 | + | ||
151 | + gtk_widget_class_install_style_property (widget_class, | ||
152 | + g_param_spec_int ("minimum_width", | ||
153 | + P_("Minimum Width"), | ||
154 | + P_("Minimum width of the button"), | ||
155 | + 0, | ||
156 | + G_MAXINT, | ||
157 | + 0, | ||
158 | + G_PARAM_READABLE)); | ||
159 | |||
160 | g_type_class_add_private (gobject_class, sizeof (GtkButtonPrivate)); | ||
161 | } | ||
162 | @@ -445,7 +560,14 @@ | ||
163 | priv->xalign = 0.5; | ||
164 | priv->yalign = 0.5; | ||
165 | priv->align_set = 0; | ||
166 | + priv->detail = g_strdup("buttondefault"); | ||
167 | + priv->automatic_detail = TRUE; | ||
168 | + priv->keyboard_button = FALSE; | ||
169 | + priv->keyboard_label = NULL; | ||
170 | priv->image_is_stock = TRUE; | ||
171 | + | ||
172 | + g_object_set (G_OBJECT (button), "tap_and_hold_state", | ||
173 | + GTK_STATE_ACTIVE, NULL); | ||
174 | } | ||
175 | |||
176 | static void | ||
177 | @@ -560,6 +682,18 @@ | ||
178 | case PROP_YALIGN: | ||
179 | gtk_button_set_alignment (button, priv->xalign, g_value_get_float (value)); | ||
180 | break; | ||
181 | + case PROP_DETAIL: | ||
182 | + if (priv->detail) | ||
183 | + g_free (priv->detail); | ||
184 | + priv->detail = g_strdup (g_value_get_string (value)); | ||
185 | + gtk_widget_queue_draw (GTK_WIDGET (button)); | ||
186 | + break; | ||
187 | + case PROP_AUTOMATIC_DETAIL: | ||
188 | + priv->automatic_detail = g_value_get_boolean (value); | ||
189 | + break; | ||
190 | + case PROP_KEYBOARD_BUTTON: | ||
191 | + priv->keyboard_button = g_value_get_boolean (value); | ||
192 | + break; | ||
193 | default: | ||
194 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
195 | break; | ||
196 | @@ -601,6 +735,15 @@ | ||
197 | case PROP_YALIGN: | ||
198 | g_value_set_float (value, priv->yalign); | ||
199 | break; | ||
200 | + case PROP_DETAIL: | ||
201 | + g_value_set_string (value, priv->detail); | ||
202 | + break; | ||
203 | + case PROP_AUTOMATIC_DETAIL: | ||
204 | + g_value_set_boolean (value, priv->automatic_detail); | ||
205 | + break; | ||
206 | + case PROP_KEYBOARD_BUTTON: | ||
207 | + g_value_set_boolean (value, priv->keyboard_button); | ||
208 | + break; | ||
209 | default: | ||
210 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
211 | break; | ||
212 | @@ -641,6 +784,26 @@ | ||
213 | if (button->label_text == NULL) | ||
214 | return; | ||
215 | |||
216 | + if (priv->keyboard_button) | ||
217 | + { | ||
218 | + if (priv->keyboard_label) | ||
219 | + { | ||
220 | + gtk_label_set_label (priv->keyboard_label, button->label_text); | ||
221 | + } | ||
222 | + else | ||
223 | + { | ||
224 | + GtkWidget *label = gtk_label_new (button->label_text); | ||
225 | + priv->keyboard_label = GTK_LABEL (label); | ||
226 | + | ||
227 | + if (priv->align_set) | ||
228 | + gtk_misc_set_alignment (GTK_MISC (label), | ||
229 | + priv->xalign, priv->yalign); | ||
230 | + gtk_widget_show (priv->keyboard_label); | ||
231 | + gtk_container_add (GTK_CONTAINER (button), label); | ||
232 | + } | ||
233 | + return; | ||
234 | + } | ||
235 | + | ||
236 | if (GTK_BIN (button)->child) | ||
237 | { | ||
238 | if (priv->image && !priv->image_is_stock) | ||
239 | @@ -944,16 +1107,20 @@ | ||
240 | GtkBorder default_border; | ||
241 | gint focus_width; | ||
242 | gint focus_pad; | ||
243 | + gint child_spacing; | ||
244 | + gint separator_height; | ||
245 | |||
246 | gtk_button_get_props (button, &default_border, NULL, NULL); | ||
247 | gtk_widget_style_get (GTK_WIDGET (widget), | ||
248 | "focus-line-width", &focus_width, | ||
249 | "focus-padding", &focus_pad, | ||
250 | + "child-spacing", &child_spacing, | ||
251 | + "separator-height", &separator_height, | ||
252 | NULL); | ||
253 | |||
254 | - requisition->width = (GTK_CONTAINER (widget)->border_width + CHILD_SPACING + | ||
255 | + requisition->width = (GTK_CONTAINER (widget)->border_width + child_spacing + | ||
256 | GTK_WIDGET (widget)->style->xthickness) * 2; | ||
257 | - requisition->height = (GTK_CONTAINER (widget)->border_width + CHILD_SPACING + | ||
258 | + requisition->height = (GTK_CONTAINER (widget)->border_width + child_spacing + | ||
259 | GTK_WIDGET (widget)->style->ythickness) * 2; | ||
260 | |||
261 | if (GTK_WIDGET_CAN_DEFAULT (widget)) | ||
262 | @@ -965,15 +1132,35 @@ | ||
263 | if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child)) | ||
264 | { | ||
265 | GtkRequisition child_requisition; | ||
266 | + GtkBorder *padding; | ||
267 | + gint minimum_width; | ||
268 | |||
269 | gtk_widget_size_request (GTK_BIN (button)->child, &child_requisition); | ||
270 | |||
271 | + gtk_widget_style_get (widget, | ||
272 | + "padding", | ||
273 | + &padding, | ||
274 | + "minimum_width", | ||
275 | + &minimum_width, | ||
276 | + NULL); | ||
277 | + | ||
278 | + if ( padding ) | ||
279 | + { | ||
280 | + requisition->width += padding->left + padding->right; | ||
281 | + requisition->height += padding->top + padding->bottom; | ||
282 | + } | ||
283 | + | ||
284 | requisition->width += child_requisition.width; | ||
285 | requisition->height += child_requisition.height; | ||
286 | + | ||
287 | + if (requisition->width < minimum_width) | ||
288 | + requisition->width = minimum_width; | ||
289 | } | ||
290 | |||
291 | requisition->width += 2 * (focus_width + focus_pad); | ||
292 | requisition->height += 2 * (focus_width + focus_pad); | ||
293 | + | ||
294 | + requisition->height += separator_height; | ||
295 | } | ||
296 | |||
297 | static void | ||
298 | @@ -989,14 +1176,15 @@ | ||
299 | GtkBorder default_border; | ||
300 | gint focus_width; | ||
301 | gint focus_pad; | ||
302 | + gint child_spacing; | ||
303 | |||
304 | gtk_button_get_props (button, &default_border, NULL, NULL); | ||
305 | gtk_widget_style_get (GTK_WIDGET (widget), | ||
306 | "focus-line-width", &focus_width, | ||
307 | "focus-padding", &focus_pad, | ||
308 | + "child-spacing", &child_spacing, | ||
309 | NULL); | ||
310 | - | ||
311 | - | ||
312 | + | ||
313 | widget->allocation = *allocation; | ||
314 | |||
315 | if (GTK_WIDGET_REALIZED (widget)) | ||
316 | @@ -1008,14 +1196,27 @@ | ||
317 | |||
318 | if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child)) | ||
319 | { | ||
320 | - child_allocation.x = widget->allocation.x + border_width + CHILD_SPACING + xthickness; | ||
321 | - child_allocation.y = widget->allocation.y + border_width + CHILD_SPACING + ythickness; | ||
322 | + child_allocation.x = widget->allocation.x + border_width + child_spacing + xthickness; | ||
323 | + child_allocation.y = widget->allocation.y + border_width + child_spacing + ythickness; | ||
324 | |||
325 | - child_allocation.width = MAX (1, widget->allocation.width - (CHILD_SPACING + xthickness) * 2 - | ||
326 | + child_allocation.width = MAX (1, widget->allocation.width - (child_spacing + xthickness) * 2 - | ||
327 | border_width * 2); | ||
328 | - child_allocation.height = MAX (1, widget->allocation.height - (CHILD_SPACING + ythickness) * 2 - | ||
329 | + child_allocation.height = MAX (1, widget->allocation.height - (child_spacing + ythickness) * 2 - | ||
330 | border_width * 2); | ||
331 | |||
332 | +#ifdef OSSO_FONT_HACK | ||
333 | + { | ||
334 | + gint child_offset_y; | ||
335 | + | ||
336 | + gtk_widget_style_get (widget, "child_offset_y", &child_offset_y, NULL); | ||
337 | + | ||
338 | + if( GTK_IS_LABEL(GTK_BIN (button)->child) ) | ||
339 | + { | ||
340 | + child_allocation.y += child_offset_y; | ||
341 | + } | ||
342 | + } | ||
343 | +#endif | ||
344 | + | ||
345 | if (GTK_WIDGET_CAN_DEFAULT (button)) | ||
346 | { | ||
347 | child_allocation.x += default_border.left; | ||
348 | @@ -1066,7 +1267,14 @@ | ||
349 | gboolean interior_focus; | ||
350 | gint focus_width; | ||
351 | gint focus_pad; | ||
352 | - | ||
353 | + gint separator_height; | ||
354 | + gboolean listboxheader; | ||
355 | + GtkButtonPrivate *priv; | ||
356 | + | ||
357 | + g_return_if_fail (GTK_IS_BUTTON (button)); | ||
358 | + | ||
359 | + priv = GTK_BUTTON_GET_PRIVATE (button); | ||
360 | + | ||
361 | if (GTK_WIDGET_DRAWABLE (button)) | ||
362 | { | ||
363 | widget = GTK_WIDGET (button); | ||
364 | @@ -1076,6 +1284,8 @@ | ||
365 | gtk_widget_style_get (GTK_WIDGET (widget), | ||
366 | "focus-line-width", &focus_width, | ||
367 | "focus-padding", &focus_pad, | ||
368 | + "listboxheader", &listboxheader, | ||
369 | + "separator-height", &separator_height, | ||
370 | NULL); | ||
371 | |||
372 | x = widget->allocation.x + border_width; | ||
373 | @@ -1083,13 +1293,55 @@ | ||
374 | width = widget->allocation.width - border_width * 2; | ||
375 | height = widget->allocation.height - border_width * 2; | ||
376 | |||
377 | + if (listboxheader) | ||
378 | + { | ||
379 | + /* this changes everything! */ | ||
380 | + PangoLayout *layout; | ||
381 | + int layout_height; | ||
382 | + | ||
383 | + /* construct layout - see get_layout in gtkcellrenderertext.c */ | ||
384 | + layout = gtk_widget_create_pango_layout (widget, /* use parent treeview instead? */ | ||
385 | + button->label_text); | ||
386 | + pango_layout_set_width (layout, -1); | ||
387 | + pango_layout_get_pixel_size (layout, NULL, &layout_height); | ||
388 | + | ||
389 | + /* render text */ | ||
390 | + gtk_paint_layout (widget->style, | ||
391 | + widget->window, | ||
392 | + GTK_STATE_NORMAL, | ||
393 | + TRUE, | ||
394 | + area, | ||
395 | + widget, | ||
396 | + "listboxheader", | ||
397 | + x, | ||
398 | + y, | ||
399 | + layout); | ||
400 | + | ||
401 | + g_object_unref (layout); | ||
402 | + | ||
403 | + /* draw separator */ | ||
404 | + gtk_paint_hline (widget->style, | ||
405 | + widget->window, | ||
406 | + GTK_STATE_NORMAL, | ||
407 | + area, | ||
408 | + widget, | ||
409 | + "listboxseparator", | ||
410 | + area->x - focus_width - focus_pad, | ||
411 | + area->x + area->width + focus_width + focus_pad, | ||
412 | + layout_height + separator_height * 2); | ||
413 | + return; | ||
414 | + } | ||
415 | + | ||
416 | if (GTK_WIDGET_HAS_DEFAULT (widget) && | ||
417 | GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL) | ||
418 | { | ||
419 | - gtk_paint_box (widget->style, widget->window, | ||
420 | + /* This comment is here because it's part of the | ||
421 | + * normal GtkButton | ||
422 | + */ | ||
423 | + /* gtk_paint_box (widget->style, widget->window, | ||
424 | GTK_STATE_NORMAL, GTK_SHADOW_IN, | ||
425 | area, widget, "buttondefault", | ||
426 | - x, y, width, height); | ||
427 | + x, y, width, height); */ | ||
428 | |||
429 | x += default_border.left; | ||
430 | y += default_border.top; | ||
431 | @@ -1116,7 +1368,7 @@ | ||
432 | GTK_WIDGET_STATE(widget) == GTK_STATE_PRELIGHT) | ||
433 | gtk_paint_box (widget->style, widget->window, | ||
434 | state_type, | ||
435 | - shadow_type, area, widget, "button", | ||
436 | + shadow_type, area, widget, priv->detail, | ||
437 | x, y, width, height); | ||
438 | |||
439 | if (GTK_WIDGET_HAS_FOCUS (widget)) | ||
440 | @@ -1151,10 +1403,14 @@ | ||
441 | x += child_displacement_x; | ||
442 | y += child_displacement_y; | ||
443 | } | ||
444 | - | ||
445 | + /* Comment exists, because it is part of normal GtkButton | ||
446 | gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget), | ||
447 | area, widget, "button", | ||
448 | x, y, width, height); | ||
449 | + */ | ||
450 | + gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget), | ||
451 | + area, widget, priv->detail, | ||
452 | + x, y, width, height); | ||
453 | } | ||
454 | } | ||
455 | } | ||
456 | @@ -1786,5 +2042,13 @@ | ||
457 | |||
458 | return priv->image; | ||
459 | } | ||
460 | - | ||
461 | - | ||
462 | +void osso_gtk_button_set_detail_from_attach_flags (GtkButton *button,OssoGtkButtonAttachFlags flags) | ||
463 | +{ | ||
464 | + g_return_if_fail (GTK_IS_BUTTON (button)); | ||
465 | + g_object_set (G_OBJECT (button), | ||
466 | + "automatic_detail", | ||
467 | + FALSE, | ||
468 | + "detail", | ||
469 | + osso_gtk_button_attach_details[flags], | ||
470 | + NULL); | ||
471 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkbutton.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkbutton.h.diff deleted file mode 100644 index 4c233f905b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkbutton.h.diff +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkbutton.h 2004-11-15 22:56:28.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkbutton.h 2005-04-06 16:19:36.264025392 +0300 | ||
3 | @@ -134,6 +134,20 @@ | ||
4 | const gchar *main_detail, | ||
5 | const gchar *default_detail); | ||
6 | |||
7 | +/* Osso addition : Button attach flags */ | ||
8 | +typedef enum { | ||
9 | + OSSO_GTK_BUTTON_ATTACH_NORTH = 1 << 0, | ||
10 | + OSSO_GTK_BUTTON_ATTACH_EAST = 1 << 1, | ||
11 | + OSSO_GTK_BUTTON_ATTACH_SOUTH = 1 << 2, | ||
12 | + OSSO_GTK_BUTTON_ATTACH_WEST = 1 << 3, | ||
13 | + OSSO_GTK_BUTTON_ATTACH_ENUM_END = 1 << 4 | ||
14 | +} OssoGtkButtonAttachFlags; | ||
15 | + | ||
16 | +extern const gchar *osso_gtk_button_attach_details [OSSO_GTK_BUTTON_ATTACH_ENUM_END]; | ||
17 | + | ||
18 | +void osso_gtk_button_set_detail_from_attach_flags (GtkButton *button, | ||
19 | + OssoGtkButtonAttachFlags flags); | ||
20 | + | ||
21 | #ifdef __cplusplus | ||
22 | } | ||
23 | #endif /* __cplusplus */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcalendar.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcalendar.c.diff deleted file mode 100644 index e32c05452d..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcalendar.c.diff +++ /dev/null | |||
@@ -1,2464 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcalendar.c 2004-11-12 19:51:58.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcalendar.c 2005-04-06 16:19:36.267024936 +0300 | ||
3 | @@ -169,14 +169,23 @@ | ||
4 | |||
5 | /*** END OF lib_date routines ********************************************/ | ||
6 | |||
7 | +/* HILDON: Spacings modified */ | ||
8 | + | ||
9 | +#define HILDON_ARROW_WIDTH 20 | ||
10 | +#define HILDON_ARROW_HEIGHT 27 | ||
11 | +#define HILDON_ARROW_SEP 5 /* Space between arrows and data */ | ||
12 | + | ||
13 | +#define HILDON_DAY_WIDTH 26 | ||
14 | +#define HILDON_DAY_HEIGHT 25 | ||
15 | + | ||
16 | /* Spacing around day/week headers and main area, inside those windows */ | ||
17 | #define CALENDAR_MARGIN 0 | ||
18 | /* Spacing around day/week headers and main area, outside those windows */ | ||
19 | -#define INNER_BORDER 4 | ||
20 | +#define INNER_BORDER 0 /* 4 */ | ||
21 | /* Separation between day headers and main area */ | ||
22 | -#define CALENDAR_YSEP 4 | ||
23 | +#define CALENDAR_YSEP 3 /* 4 */ | ||
24 | /* Separation between week headers and main area */ | ||
25 | -#define CALENDAR_XSEP 4 | ||
26 | +#define CALENDAR_XSEP 6 /* 4 */ | ||
27 | |||
28 | #define DAY_XSEP 0 /* not really good for small calendar */ | ||
29 | #define DAY_YSEP 0 /* not really good for small calendar */ | ||
30 | @@ -193,6 +202,10 @@ | ||
31 | #define BACKGROUND_COLOR(widget) (& (widget)->style->base[GTK_WIDGET_STATE (widget)]) | ||
32 | #define HIGHLIGHT_BACK_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)]) | ||
33 | |||
34 | +/* Default Min/Max years for hildon calendar */ | ||
35 | +#define HILDON_MIN_YEAR 0 | ||
36 | +#define HILDON_MAX_YEAR 2999 | ||
37 | + | ||
38 | enum { | ||
39 | ARROW_YEAR_LEFT, | ||
40 | ARROW_YEAR_RIGHT, | ||
41 | @@ -214,6 +227,8 @@ | ||
42 | NEXT_MONTH_SIGNAL, | ||
43 | PREV_YEAR_SIGNAL, | ||
44 | NEXT_YEAR_SIGNAL, | ||
45 | + ERRONEOUS_DATE_SIGNAL, | ||
46 | + SELECTED_DATE_SIGNAL, | ||
47 | LAST_SIGNAL | ||
48 | }; | ||
49 | |||
50 | @@ -238,16 +253,19 @@ | ||
51 | struct _GtkCalendarPrivateData | ||
52 | { | ||
53 | GdkWindow *header_win; | ||
54 | + GdkWindow *footer_win; /* HILDON: Added below calendar */ | ||
55 | GdkWindow *day_name_win; | ||
56 | GdkWindow *main_win; | ||
57 | GdkWindow *week_win; | ||
58 | GdkWindow *arrow_win[4]; | ||
59 | |||
60 | + gint year_before; | ||
61 | guint header_h; | ||
62 | guint day_name_h; | ||
63 | guint main_h; | ||
64 | |||
65 | guint arrow_state[4]; | ||
66 | + /* guint arrow_width; This is now defined constant. Even normal Gtk don't allow to change this */ | ||
67 | guint arrow_width; | ||
68 | guint max_month_width; | ||
69 | guint max_year_width; | ||
70 | @@ -271,7 +289,7 @@ | ||
71 | guint dirty_main : 1; | ||
72 | guint dirty_week : 1; | ||
73 | |||
74 | - guint year_before : 1; | ||
75 | +/* guint year_before : 1;*/ | ||
76 | |||
77 | guint need_timer : 1; | ||
78 | |||
79 | @@ -281,6 +299,27 @@ | ||
80 | guint32 timer; | ||
81 | gint click_child; | ||
82 | |||
83 | + /* Following variables are for current date */ | ||
84 | + guint current_day; | ||
85 | + guint current_month; | ||
86 | + guint current_year; | ||
87 | + | ||
88 | + /* Keep track of day and month | ||
89 | + * where mouse button was pressed | ||
90 | + */ | ||
91 | + guint pressed_day; | ||
92 | + guint pressed_month; | ||
93 | + | ||
94 | + /* Boolean value to indicate if | ||
95 | + * out of bound day was selected | ||
96 | + */ | ||
97 | + gboolean is_bad_day; | ||
98 | + | ||
99 | + /* Must check if we are sliding stylus */ | ||
100 | + gboolean slide_stylus; | ||
101 | + gint prev_row; | ||
102 | + gint prev_col; | ||
103 | + | ||
104 | gint week_start; | ||
105 | |||
106 | gint drag_start_x; | ||
107 | @@ -336,6 +375,8 @@ | ||
108 | static void gtk_calendar_style_set (GtkWidget *widget, | ||
109 | GtkStyle *previous_style); | ||
110 | static void gtk_calendar_paint_header (GtkWidget *widget); | ||
111 | +static void gtk_calendar_paint_footer (GtkWidget *widget); | ||
112 | + | ||
113 | static void gtk_calendar_paint_day_names (GtkWidget *widget); | ||
114 | static void gtk_calendar_paint_week_numbers (GtkWidget *widget); | ||
115 | static void gtk_calendar_paint_main (GtkWidget *widget); | ||
116 | @@ -381,7 +422,13 @@ | ||
117 | gint x, | ||
118 | gint y, | ||
119 | guint time); | ||
120 | - | ||
121 | + | ||
122 | +/* This function was added because we need to mark current day according to | ||
123 | + * specifications | ||
124 | + */ | ||
125 | +static void | ||
126 | +gtk_calendar_check_current_date (GtkCalendar *calendar, gint x, gint y); | ||
127 | + | ||
128 | static char *default_abbreviated_dayname[7]; | ||
129 | static char *default_monthname[12]; | ||
130 | |||
131 | @@ -461,6 +508,8 @@ | ||
132 | class->next_month = NULL; | ||
133 | class->prev_year = NULL; | ||
134 | class->next_year = NULL; | ||
135 | + class->erroneous_date = NULL; | ||
136 | + class->selected_date = NULL; | ||
137 | |||
138 | g_object_class_install_property (gobject_class, | ||
139 | PROP_YEAR, | ||
140 | @@ -543,6 +592,31 @@ | ||
141 | FALSE, | ||
142 | G_PARAM_READWRITE)); | ||
143 | |||
144 | + gtk_widget_class_install_style_property (widget_class, | ||
145 | + g_param_spec_int ("min-year", | ||
146 | + P_("Minimum year for calendar"), | ||
147 | + P_("Set minimum year calendar accepts"), | ||
148 | + 0, | ||
149 | + G_MAXINT, | ||
150 | + HILDON_MIN_YEAR, | ||
151 | + G_PARAM_READWRITE)); | ||
152 | + | ||
153 | + gtk_widget_class_install_style_property (widget_class, | ||
154 | + g_param_spec_int ("max-year", | ||
155 | + P_("Maximum year for calendar"), | ||
156 | + P_("Set max year that calendar accepts"), | ||
157 | + 0, | ||
158 | + G_MAXINT, | ||
159 | + HILDON_MAX_YEAR, | ||
160 | + G_PARAM_READWRITE)); | ||
161 | + | ||
162 | + gtk_widget_class_install_style_property (widget_class, | ||
163 | + g_param_spec_boolean ("hildonlike", | ||
164 | + _("Size request"), | ||
165 | + _("Size allocate"), | ||
166 | + FALSE, | ||
167 | + G_PARAM_READABLE)); | ||
168 | + | ||
169 | gtk_calendar_signals[MONTH_CHANGED_SIGNAL] = | ||
170 | g_signal_new ("month_changed", | ||
171 | G_OBJECT_CLASS_TYPE (gobject_class), | ||
172 | @@ -599,6 +673,22 @@ | ||
173 | NULL, NULL, | ||
174 | _gtk_marshal_VOID__VOID, | ||
175 | G_TYPE_NONE, 0); | ||
176 | + gtk_calendar_signals[ERRONEOUS_DATE_SIGNAL] = | ||
177 | + g_signal_new ("erroneous_date", | ||
178 | + G_OBJECT_CLASS_TYPE(gobject_class), | ||
179 | + G_SIGNAL_RUN_FIRST, | ||
180 | + G_STRUCT_OFFSET (GtkCalendarClass, erroneous_date), | ||
181 | + NULL, NULL, | ||
182 | + _gtk_marshal_VOID__VOID, | ||
183 | + G_TYPE_NONE, 0); | ||
184 | + gtk_calendar_signals[SELECTED_DATE_SIGNAL] = | ||
185 | + g_signal_new ("selected_date", | ||
186 | + G_OBJECT_CLASS_TYPE(gobject_class), | ||
187 | + G_SIGNAL_RUN_FIRST, | ||
188 | + G_STRUCT_OFFSET (GtkCalendarClass, selected_date), | ||
189 | + NULL, NULL, | ||
190 | + _gtk_marshal_VOID__VOID, | ||
191 | + G_TYPE_NONE, 0); | ||
192 | } | ||
193 | |||
194 | static void | ||
195 | @@ -611,8 +701,10 @@ | ||
196 | time_t tmp_time; | ||
197 | GtkWidget *widget; | ||
198 | GtkCalendarPrivateData *private_data; | ||
199 | - gchar *year_before; | ||
200 | +/* gchar *year_before;*/ | ||
201 | gchar *week_start; | ||
202 | +/* gint row; | ||
203 | + gint col; */ | ||
204 | |||
205 | widget = GTK_WIDGET (calendar); | ||
206 | GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS); | ||
207 | @@ -645,16 +737,29 @@ | ||
208 | for (i=0;i<31;i++) | ||
209 | calendar->marked_date[i] = FALSE; | ||
210 | calendar->num_marked_dates = 0; | ||
211 | - calendar->selected_day = tm->tm_mday; | ||
212 | - | ||
213 | + calendar->selected_day = tm->tm_mday; | ||
214 | + | ||
215 | calendar->display_flags = ( GTK_CALENDAR_SHOW_HEADING | | ||
216 | GTK_CALENDAR_SHOW_DAY_NAMES ); | ||
217 | |||
218 | + /* Hildon: we should mark current day and we need to store current date */ | ||
219 | + private_data->current_day = tm->tm_mday; | ||
220 | + private_data->current_month = tm->tm_mon; | ||
221 | + private_data->current_year = tm->tm_year + 1900; | ||
222 | + | ||
223 | + /* Hildon: following lines are for stylus sliding */ | ||
224 | + private_data->slide_stylus = FALSE; | ||
225 | + private_data->prev_row = -1; | ||
226 | + private_data->prev_col = -1; | ||
227 | + | ||
228 | + /* Hildon: is_bad_day indicate if day was selected out of legal range */ | ||
229 | + private_data->is_bad_day = FALSE; | ||
230 | + | ||
231 | calendar->highlight_row = -1; | ||
232 | - calendar->highlight_col = -1; | ||
233 | + calendar->highlight_col = -1; | ||
234 | |||
235 | calendar->focus_row = -1; | ||
236 | - calendar->focus_col = -1; | ||
237 | + calendar->focus_col = -1; | ||
238 | calendar->xor_gc = NULL; | ||
239 | |||
240 | private_data->max_year_width = 0; | ||
241 | @@ -667,7 +772,7 @@ | ||
242 | private_data->max_label_char_ascent = 0; | ||
243 | private_data->max_label_char_descent = 0; | ||
244 | |||
245 | - private_data->arrow_width = 10; | ||
246 | +/* private_data->arrow_width = 10;*/ | ||
247 | |||
248 | private_data->freeze_count = 0; | ||
249 | |||
250 | @@ -686,6 +791,7 @@ | ||
251 | gtk_drag_dest_set (widget, 0, NULL, 0, GDK_ACTION_COPY); | ||
252 | gtk_drag_dest_add_text_targets (widget); | ||
253 | |||
254 | +#if 0 | ||
255 | private_data->year_before = 0; | ||
256 | |||
257 | /* Translate to calendar:YM if you want years to be displayed | ||
258 | @@ -702,11 +808,13 @@ | ||
259 | private_data->year_before = 1; | ||
260 | else if (strcmp (year_before, "calendar:MY") != 0) | ||
261 | g_warning ("Whoever translated calendar:MY did so wrongly.\n"); | ||
262 | +#endif | ||
263 | |||
264 | /* Translate to calendar:week_start:0 if you want Sunday to be the | ||
265 | * first day of the week to calendar:week_start:1 if you want Monday | ||
266 | * to be the first day of the week, and so on. | ||
267 | */ | ||
268 | + | ||
269 | week_start = _("calendar:week_start:0"); | ||
270 | |||
271 | if (strncmp (week_start, "calendar:week_start:", 20) == 0) | ||
272 | @@ -752,7 +860,7 @@ | ||
273 | |||
274 | return column; | ||
275 | } | ||
276 | - | ||
277 | +#if 0 | ||
278 | static gint | ||
279 | row_height (GtkCalendar *calendar) | ||
280 | { | ||
281 | @@ -760,7 +868,7 @@ | ||
282 | - ((calendar->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES) | ||
283 | ? CALENDAR_YSEP : CALENDAR_MARGIN)) / 6; | ||
284 | } | ||
285 | - | ||
286 | +#endif | ||
287 | |||
288 | /* row_from_y: returns the row 0-5 that the | ||
289 | * y pixel of the xwindow is in */ | ||
290 | @@ -769,16 +877,15 @@ | ||
291 | gint event_y) | ||
292 | { | ||
293 | gint r, row; | ||
294 | - gint height; | ||
295 | + /*gint height;*/ | ||
296 | gint y_top, y_bottom; | ||
297 | |||
298 | - height = row_height (calendar); | ||
299 | row = -1; | ||
300 | |||
301 | for (r = 0; r < 6; r++) | ||
302 | { | ||
303 | y_top = top_y_for_row (calendar, r); | ||
304 | - y_bottom = y_top + height; | ||
305 | + y_bottom = y_top + HILDON_DAY_HEIGHT /*height*/; | ||
306 | |||
307 | if (event_y >= y_top && event_y < y_bottom) | ||
308 | { | ||
309 | @@ -796,16 +903,16 @@ | ||
310 | { | ||
311 | gint width; | ||
312 | gint x_left; | ||
313 | - | ||
314 | + | ||
315 | if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL) | ||
316 | column = 6 - column; | ||
317 | - | ||
318 | + | ||
319 | width = GTK_CALENDAR_PRIVATE_DATA (calendar)->day_width; | ||
320 | if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS) | ||
321 | x_left = CALENDAR_XSEP + (width + DAY_XSEP) * column; | ||
322 | else | ||
323 | x_left = CALENDAR_MARGIN + (width + DAY_XSEP) * column; | ||
324 | - | ||
325 | + | ||
326 | return x_left; | ||
327 | } | ||
328 | |||
329 | @@ -818,25 +925,41 @@ | ||
330 | |||
331 | return (GTK_CALENDAR_PRIVATE_DATA (calendar)->main_h | ||
332 | - (CALENDAR_MARGIN + (6 - row) | ||
333 | - * row_height (calendar))); | ||
334 | + * HILDON_DAY_HEIGHT)); | ||
335 | } | ||
336 | |||
337 | static void | ||
338 | gtk_calendar_set_month_prev (GtkCalendar *calendar) | ||
339 | { | ||
340 | gint month_len; | ||
341 | - | ||
342 | + gint min_year; | ||
343 | + gboolean hildonlike; | ||
344 | + | ||
345 | + gtk_widget_style_get (GTK_WIDGET (calendar), "hildonlike", &hildonlike, | ||
346 | + "min-year", &min_year, NULL); | ||
347 | + | ||
348 | if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE) | ||
349 | return; | ||
350 | |||
351 | if (calendar->month == 0) | ||
352 | - { | ||
353 | - calendar->month = 11; | ||
354 | - calendar->year--; | ||
355 | - } | ||
356 | - else | ||
357 | - calendar->month--; | ||
358 | - | ||
359 | + { | ||
360 | + if (hildonlike) | ||
361 | + { | ||
362 | + if (calendar->year > min_year) | ||
363 | + { | ||
364 | + calendar->month = 11; | ||
365 | + calendar->year--; | ||
366 | + } | ||
367 | + } | ||
368 | + else | ||
369 | + { | ||
370 | + calendar->month = 11; | ||
371 | + calendar->year--; | ||
372 | + } | ||
373 | + } | ||
374 | + else | ||
375 | + calendar->month--; | ||
376 | + | ||
377 | month_len = month_length[leap (calendar->year)][calendar->month + 1]; | ||
378 | |||
379 | gtk_calendar_freeze (calendar); | ||
380 | @@ -870,17 +993,32 @@ | ||
381 | gtk_calendar_set_month_next (GtkCalendar *calendar) | ||
382 | { | ||
383 | gint month_len; | ||
384 | + gint max_year; | ||
385 | + gboolean hildonlike; | ||
386 | |||
387 | g_return_if_fail (GTK_IS_WIDGET (calendar)); | ||
388 | |||
389 | + gtk_widget_style_get (GTK_WIDGET (calendar), "hildonlike", &hildonlike, | ||
390 | + "max-year", &max_year, NULL); | ||
391 | + | ||
392 | if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE) | ||
393 | return; | ||
394 | |||
395 | - | ||
396 | if (calendar->month == 11) | ||
397 | { | ||
398 | - calendar->month = 0; | ||
399 | - calendar->year++; | ||
400 | + if (hildonlike) | ||
401 | + { | ||
402 | + if (calendar->year < max_year) | ||
403 | + { | ||
404 | + calendar->month = 0; | ||
405 | + calendar->year++; | ||
406 | + } | ||
407 | + } | ||
408 | + else | ||
409 | + { | ||
410 | + calendar->month = 0; | ||
411 | + calendar->year++; | ||
412 | + } | ||
413 | } | ||
414 | else | ||
415 | calendar->month++; | ||
416 | @@ -912,10 +1050,22 @@ | ||
417 | gtk_calendar_set_year_prev (GtkCalendar *calendar) | ||
418 | { | ||
419 | gint month_len; | ||
420 | - | ||
421 | + gint min_year; | ||
422 | + gboolean hildonlike; | ||
423 | + | ||
424 | g_return_if_fail (GTK_IS_WIDGET (calendar)); | ||
425 | |||
426 | - calendar->year--; | ||
427 | + gtk_widget_style_get (GTK_WIDGET (calendar), "hildonlike", &hildonlike, | ||
428 | + "min-year", &min_year, NULL); | ||
429 | + | ||
430 | + if (hildonlike) | ||
431 | + { | ||
432 | + if (calendar->year > min_year) | ||
433 | + calendar->year--; | ||
434 | + } | ||
435 | + else | ||
436 | + calendar->year--; | ||
437 | + | ||
438 | gtk_calendar_freeze (calendar); | ||
439 | gtk_calendar_compute_days (calendar); | ||
440 | g_signal_emit (calendar, | ||
441 | @@ -944,14 +1094,26 @@ | ||
442 | { | ||
443 | gint month_len; | ||
444 | GtkWidget *widget; | ||
445 | + gint max_year; | ||
446 | + gboolean hildonlike; | ||
447 | |||
448 | g_return_if_fail (GTK_IS_WIDGET (calendar)); | ||
449 | |||
450 | widget = GTK_WIDGET (calendar); | ||
451 | + | ||
452 | + gtk_widget_style_get(widget, "hildonlike", &hildonlike, | ||
453 | + "max-year", &max_year, NULL); | ||
454 | |||
455 | gtk_calendar_freeze (calendar); | ||
456 | |||
457 | - calendar->year++; | ||
458 | + if (hildonlike) | ||
459 | + { | ||
460 | + if (calendar->year < max_year) | ||
461 | + calendar->year++; | ||
462 | + } | ||
463 | + else | ||
464 | + calendar->year++; | ||
465 | + | ||
466 | gtk_calendar_compute_days (calendar); | ||
467 | g_signal_emit (calendar, | ||
468 | gtk_calendar_signals[NEXT_YEAR_SIGNAL], | ||
469 | @@ -969,7 +1131,6 @@ | ||
470 | } | ||
471 | else | ||
472 | gtk_calendar_select_day (calendar, calendar->selected_day); | ||
473 | - | ||
474 | gtk_widget_queue_draw (GTK_WIDGET (calendar)); | ||
475 | gtk_calendar_thaw (calendar); | ||
476 | } | ||
477 | @@ -984,6 +1145,8 @@ | ||
478 | gint row, col; | ||
479 | gint day_month; | ||
480 | gint day; | ||
481 | + gint max_year, min_year; | ||
482 | + gboolean hildonlike; | ||
483 | |||
484 | calendar = GTK_CALENDAR (widget); | ||
485 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
486 | @@ -997,20 +1160,36 @@ | ||
487 | /* If row or column isn't found, just return. */ | ||
488 | if (row == -1 || col == -1) | ||
489 | return; | ||
490 | - | ||
491 | - day_month = calendar->day_month[row][col]; | ||
492 | |||
493 | - if (event->type == GDK_BUTTON_PRESS) | ||
494 | + gtk_widget_style_get (GTK_WIDGET (calendar), "hildonlike", &hildonlike, | ||
495 | + "max-year", &max_year, "min-year", &min_year, NULL); | ||
496 | + day_month = calendar->day_month[row][col]; | ||
497 | + | ||
498 | + if (hildonlike) | ||
499 | + { | ||
500 | + if ((calendar->year == min_year && calendar->month == 0 && day_month == MONTH_PREV) | ||
501 | + || (calendar->year == max_year && calendar->month == 11 && day_month == MONTH_NEXT)) | ||
502 | + { | ||
503 | + private_data->is_bad_day = TRUE; | ||
504 | + g_signal_emit (calendar, gtk_calendar_signals[ERRONEOUS_DATE_SIGNAL], 0); | ||
505 | + return; | ||
506 | + } | ||
507 | + } | ||
508 | + if (event->type == (hildonlike ? GDK_BUTTON_RELEASE : GDK_BUTTON_PRESS)) | ||
509 | { | ||
510 | day = calendar->day[row][col]; | ||
511 | |||
512 | if (day_month == MONTH_PREV) | ||
513 | - gtk_calendar_set_month_prev (calendar); | ||
514 | + { | ||
515 | + gtk_calendar_set_month_prev (calendar); | ||
516 | + } | ||
517 | else if (day_month == MONTH_NEXT) | ||
518 | - gtk_calendar_set_month_next (calendar); | ||
519 | + { | ||
520 | + gtk_calendar_set_month_next (calendar); | ||
521 | + } | ||
522 | |||
523 | if (!GTK_WIDGET_HAS_FOCUS (widget)) | ||
524 | - gtk_widget_grab_focus (widget); | ||
525 | + gtk_widget_grab_focus (widget); | ||
526 | |||
527 | if (event->button == 1) | ||
528 | { | ||
529 | @@ -1025,9 +1204,8 @@ | ||
530 | { | ||
531 | private_data->in_drag = 0; | ||
532 | if (day_month == MONTH_CURRENT) | ||
533 | - g_signal_emit (calendar, | ||
534 | - gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL], | ||
535 | - 0); | ||
536 | + g_signal_emit (calendar, | ||
537 | + gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL], 0); | ||
538 | } | ||
539 | } | ||
540 | |||
541 | @@ -1039,18 +1217,18 @@ | ||
542 | GdkWindowAttr attributes; | ||
543 | gint attributes_mask; | ||
544 | gint i; | ||
545 | - gboolean year_left; | ||
546 | + /*gboolean year_left;*/ | ||
547 | |||
548 | g_return_if_fail (GTK_IS_CALENDAR (widget)); | ||
549 | |||
550 | calendar = GTK_CALENDAR (widget); | ||
551 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
552 | - | ||
553 | +/* | ||
554 | if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) | ||
555 | year_left = private_data->year_before; | ||
556 | else | ||
557 | year_left = !private_data->year_before; | ||
558 | - | ||
559 | +*/ | ||
560 | /* Arrow windows ------------------------------------- */ | ||
561 | if (! (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE) | ||
562 | && (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING)) | ||
563 | @@ -1063,10 +1241,26 @@ | ||
564 | | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | ||
565 | | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); | ||
566 | attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; | ||
567 | - attributes.y = 3; | ||
568 | - attributes.width = private_data->arrow_width; | ||
569 | - attributes.height = private_data->header_h - 7; | ||
570 | - for (i = 0; i < 4; i++) | ||
571 | + attributes.y = 0; | ||
572 | + attributes.width = HILDON_ARROW_WIDTH; | ||
573 | + attributes.height = HILDON_ARROW_HEIGHT; | ||
574 | + | ||
575 | + attributes.x = (widget->allocation.width - private_data->max_year_width) / 2 - HILDON_ARROW_WIDTH - HILDON_ARROW_SEP; | ||
576 | + private_data->arrow_win[ARROW_YEAR_LEFT] = gdk_window_new (private_data->header_win, | ||
577 | + &attributes, attributes_mask); | ||
578 | + | ||
579 | + attributes.x = (widget->allocation.width + private_data->max_year_width) / 2 + HILDON_ARROW_SEP; | ||
580 | + private_data->arrow_win[ARROW_YEAR_RIGHT] = gdk_window_new (private_data->header_win, | ||
581 | + &attributes, attributes_mask); | ||
582 | + attributes.x = (widget->allocation.width - private_data->max_month_width) / 2 - HILDON_ARROW_WIDTH - HILDON_ARROW_SEP; | ||
583 | + private_data->arrow_win[ARROW_MONTH_LEFT] = gdk_window_new (private_data->footer_win, | ||
584 | + &attributes, attributes_mask); | ||
585 | + attributes.x = (widget->allocation.width + private_data->max_month_width) / 2 + HILDON_ARROW_SEP; | ||
586 | + private_data->arrow_win[ARROW_MONTH_RIGHT] = gdk_window_new (private_data->footer_win, | ||
587 | + &attributes, attributes_mask); | ||
588 | + | ||
589 | +/* | ||
590 | +for (i = 0; i < 4; i++) | ||
591 | { | ||
592 | switch (i) | ||
593 | { | ||
594 | @@ -1105,7 +1299,10 @@ | ||
595 | } | ||
596 | private_data->arrow_win[i] = gdk_window_new (private_data->header_win, | ||
597 | &attributes, | ||
598 | - attributes_mask); | ||
599 | + attributes_mask);*/ | ||
600 | + | ||
601 | + for (i = 0; i < 4; i++) | ||
602 | + { | ||
603 | if (GTK_WIDGET_IS_SENSITIVE (widget)) | ||
604 | private_data->arrow_state[i] = GTK_STATE_NORMAL; | ||
605 | else | ||
606 | @@ -1145,23 +1342,33 @@ | ||
607 | attributes.colormap = gtk_widget_get_colormap (widget); | ||
608 | attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; | ||
609 | attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; | ||
610 | - attributes.x = widget->style->xthickness; | ||
611 | - attributes.y = widget->style->ythickness; | ||
612 | - attributes.width = widget->allocation.width - 2 * attributes.x; | ||
613 | - attributes.height = private_data->header_h - 2 * attributes.y; | ||
614 | + attributes.x = 0 /*widget->style->xthickness*/; | ||
615 | + attributes.y = 0 /*widget->style->ythickness*/; | ||
616 | + attributes.width = widget->allocation.width; /* - 2 * attributes.x */; | ||
617 | + attributes.height = HILDON_ARROW_HEIGHT /*private_data->header_h - 2 * attributes.y*/; | ||
618 | private_data->header_win = gdk_window_new (widget->window, | ||
619 | &attributes, attributes_mask); | ||
620 | - | ||
621 | + | ||
622 | + attributes.y = HILDON_ARROW_HEIGHT + 2 * CALENDAR_YSEP + private_data->main_h + private_data->day_name_h; | ||
623 | + | ||
624 | + private_data->footer_win = gdk_window_new(widget->window, | ||
625 | + &attributes, attributes_mask); | ||
626 | + | ||
627 | gdk_window_set_background (private_data->header_win, | ||
628 | - HEADER_BG_COLOR (GTK_WIDGET (calendar))); | ||
629 | + HEADER_BG_COLOR (widget)); | ||
630 | + gdk_window_set_background (private_data->footer_win, | ||
631 | + HEADER_BG_COLOR (widget)); | ||
632 | + | ||
633 | gdk_window_show (private_data->header_win); | ||
634 | + gdk_window_show (private_data->footer_win); | ||
635 | gdk_window_set_user_data (private_data->header_win, widget); | ||
636 | - | ||
637 | + gdk_window_set_user_data (private_data->footer_win, widget); | ||
638 | } | ||
639 | else | ||
640 | { | ||
641 | private_data->header_win = NULL; | ||
642 | - } | ||
643 | + private_data->footer_win = NULL; | ||
644 | + } | ||
645 | gtk_calendar_realize_arrows (widget); | ||
646 | } | ||
647 | |||
648 | @@ -1172,7 +1379,7 @@ | ||
649 | GtkCalendarPrivateData *private_data; | ||
650 | GdkWindowAttr attributes; | ||
651 | gint attributes_mask; | ||
652 | - | ||
653 | + | ||
654 | g_return_if_fail (GTK_IS_CALENDAR (widget)); | ||
655 | |||
656 | calendar = GTK_CALENDAR (widget); | ||
657 | @@ -1187,18 +1394,16 @@ | ||
658 | attributes.colormap = gtk_widget_get_colormap (widget); | ||
659 | attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; | ||
660 | attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; | ||
661 | - attributes.x = (widget->style->xthickness + INNER_BORDER); | ||
662 | - attributes.y = private_data->header_h + (widget->style->ythickness | ||
663 | - + INNER_BORDER); | ||
664 | - attributes.width = (widget->allocation.width | ||
665 | - - (widget->style->xthickness + INNER_BORDER) | ||
666 | - * 2); | ||
667 | + attributes.x = /*private_data->week_width*/ (widget->style->xthickness + INNER_BORDER); | ||
668 | + attributes.y = private_data->header_h; | ||
669 | + attributes.width = widget->allocation.width - attributes.x; | ||
670 | attributes.height = private_data->day_name_h; | ||
671 | private_data->day_name_win = gdk_window_new (widget->window, | ||
672 | &attributes, | ||
673 | attributes_mask); | ||
674 | gdk_window_set_background (private_data->day_name_win, | ||
675 | - BACKGROUND_COLOR ( GTK_WIDGET ( calendar))); | ||
676 | + BACKGROUND_COLOR ( GTK_WIDGET (calendar))); | ||
677 | + | ||
678 | gdk_window_show (private_data->day_name_win); | ||
679 | gdk_window_set_user_data (private_data->day_name_win, widget); | ||
680 | } | ||
681 | @@ -1215,7 +1420,7 @@ | ||
682 | GtkCalendarPrivateData *private_data; | ||
683 | GdkWindowAttr attributes; | ||
684 | gint attributes_mask; | ||
685 | - | ||
686 | + | ||
687 | g_return_if_fail (GTK_IS_CALENDAR (widget)); | ||
688 | |||
689 | calendar = GTK_CALENDAR (widget); | ||
690 | @@ -1231,15 +1436,15 @@ | ||
691 | attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; | ||
692 | |||
693 | attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; | ||
694 | - attributes.x = widget->style->xthickness + INNER_BORDER; | ||
695 | - attributes.y = (private_data->header_h + private_data->day_name_h | ||
696 | - + (widget->style->ythickness + INNER_BORDER)); | ||
697 | - attributes.width = private_data->week_width; | ||
698 | - attributes.height = private_data->main_h; | ||
699 | + attributes.x = 0 /*widget->style->xthickness + INNER_BORDER*/; | ||
700 | + attributes.y = private_data->header_h; | ||
701 | + /*+ (widget->style->ythickness + INNER_BORDER))*/; | ||
702 | + attributes.width = HILDON_DAY_WIDTH; | ||
703 | + attributes.height = private_data->main_h + private_data->day_name_h; | ||
704 | private_data->week_win = gdk_window_new (widget->window, | ||
705 | - &attributes, attributes_mask); | ||
706 | + &attributes, attributes_mask); | ||
707 | gdk_window_set_background (private_data->week_win, | ||
708 | - BACKGROUND_COLOR (GTK_WIDGET (calendar))); | ||
709 | + BACKGROUND_COLOR (GTK_WIDGET (calendar))); | ||
710 | gdk_window_show (private_data->week_win); | ||
711 | gdk_window_set_user_data (private_data->week_win, widget); | ||
712 | } | ||
713 | @@ -1318,7 +1523,6 @@ | ||
714 | GDK_GC_FOREGROUND | | ||
715 | GDK_GC_FUNCTION); | ||
716 | } | ||
717 | - | ||
718 | static void | ||
719 | gtk_calendar_unrealize (GtkWidget *widget) | ||
720 | { | ||
721 | @@ -1343,7 +1547,10 @@ | ||
722 | gdk_window_set_user_data (private_data->header_win, NULL); | ||
723 | gdk_window_destroy (private_data->header_win); | ||
724 | private_data->header_win = NULL; | ||
725 | - } | ||
726 | + gdk_window_set_user_data (private_data->footer_win, NULL); | ||
727 | + gdk_window_destroy (private_data->footer_win); | ||
728 | + private_data->footer_win = NULL; | ||
729 | + } | ||
730 | |||
731 | if (private_data->week_win) | ||
732 | { | ||
733 | @@ -1382,10 +1589,10 @@ | ||
734 | PangoLayout *layout; | ||
735 | PangoRectangle logical_rect; | ||
736 | |||
737 | - gint height; | ||
738 | + /*gint height;*/ | ||
739 | gint i; | ||
740 | gchar buffer[255]; | ||
741 | - gint calendar_margin = CALENDAR_MARGIN; | ||
742 | + /*gint calendar_margin = CALENDAR_MARGIN;*/ | ||
743 | gint header_width, main_width; | ||
744 | gint max_header_height = 0; | ||
745 | gint focus_width; | ||
746 | @@ -1401,20 +1608,20 @@ | ||
747 | layout = gtk_widget_create_pango_layout (widget, NULL); | ||
748 | |||
749 | /* | ||
750 | - * Calculate the requisition width for the widget. | ||
751 | + * Calculate the requisition width for the widget. | ||
752 | */ | ||
753 | |||
754 | /* Header width */ | ||
755 | - | ||
756 | + | ||
757 | if (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING) | ||
758 | - { | ||
759 | + { | ||
760 | private_data->max_month_width = 0; | ||
761 | for (i = 0; i < 12; i++) | ||
762 | { | ||
763 | pango_layout_set_text (layout, default_monthname[i], -1); | ||
764 | pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
765 | private_data->max_month_width = MAX (private_data->max_month_width, | ||
766 | - logical_rect.width + 8); | ||
767 | + logical_rect.width +8 ); | ||
768 | max_header_height = MAX (max_header_height, logical_rect.height); | ||
769 | } | ||
770 | private_data->max_year_width = 0; | ||
771 | @@ -1427,13 +1634,13 @@ | ||
772 | logical_rect.width + 8); | ||
773 | max_header_height = MAX (max_header_height, logical_rect.height); | ||
774 | } | ||
775 | - } | ||
776 | + } | ||
777 | else | ||
778 | { | ||
779 | private_data->max_month_width = 0; | ||
780 | private_data->max_year_width = 0; | ||
781 | } | ||
782 | - | ||
783 | + | ||
784 | if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE) | ||
785 | header_width = (private_data->max_month_width | ||
786 | + private_data->max_year_width | ||
787 | @@ -1494,45 +1701,30 @@ | ||
788 | + (private_data->max_week_char_width | ||
789 | ? private_data->max_week_char_width * 2 + (focus_padding + focus_width) * 2 + CALENDAR_XSEP * 2 | ||
790 | : 0)); | ||
791 | - | ||
792 | - | ||
793 | + | ||
794 | requisition->width = MAX (header_width, main_width + INNER_BORDER * 2) + widget->style->xthickness * 2; | ||
795 | + /* FIXME: header_width is broken, when Calendar is themed ! | ||
796 | + * Next line is workaround for this bug | ||
797 | + */ | ||
798 | + requisition->width = (main_width + INNER_BORDER * 2) + widget->style->xthickness * 2; | ||
799 | |||
800 | /* | ||
801 | * Calculate the requisition height for the widget. | ||
802 | + * This is Hildon calculation | ||
803 | */ | ||
804 | - | ||
805 | + | ||
806 | if (calendar->display_flags & GTK_CALENDAR_SHOW_HEADING) | ||
807 | - { | ||
808 | - private_data->header_h = (max_header_height + CALENDAR_YSEP * 2); | ||
809 | - } | ||
810 | + private_data->header_h = HILDON_ARROW_HEIGHT + CALENDAR_YSEP; | ||
811 | else | ||
812 | - { | ||
813 | private_data->header_h = 0; | ||
814 | - } | ||
815 | - | ||
816 | + | ||
817 | if (calendar->display_flags & GTK_CALENDAR_SHOW_DAY_NAMES) | ||
818 | - { | ||
819 | - private_data->day_name_h = (private_data->max_label_char_ascent | ||
820 | - + private_data->max_label_char_descent | ||
821 | - + 2 * (focus_padding + focus_width) + calendar_margin); | ||
822 | - calendar_margin = CALENDAR_YSEP; | ||
823 | - } | ||
824 | + private_data->day_name_h = HILDON_DAY_HEIGHT; | ||
825 | else | ||
826 | - { | ||
827 | private_data->day_name_h = 0; | ||
828 | - } | ||
829 | |||
830 | - private_data->main_h = (CALENDAR_MARGIN + calendar_margin | ||
831 | - + 6 * (private_data->max_day_char_ascent | ||
832 | - + private_data->max_day_char_descent | ||
833 | - + 2 * (focus_padding + focus_width)) | ||
834 | - + DAY_YSEP * 5); | ||
835 | - | ||
836 | - height = (private_data->header_h + private_data->day_name_h | ||
837 | - + private_data->main_h); | ||
838 | - | ||
839 | - requisition->height = height + (widget->style->ythickness + INNER_BORDER) * 2; | ||
840 | + private_data->main_h = 6 * HILDON_DAY_HEIGHT; | ||
841 | + requisition->height = 2 * private_data->header_h + private_data->day_name_h + private_data->main_h; | ||
842 | |||
843 | g_object_unref (layout); | ||
844 | } | ||
845 | @@ -1544,7 +1736,7 @@ | ||
846 | GtkCalendar *calendar; | ||
847 | GtkCalendarPrivateData *private_data; | ||
848 | gint xthickness = widget->style->xthickness; | ||
849 | - gint ythickness = widget->style->xthickness; | ||
850 | + /*gint ythickness = widget->style->xthickness;*/ | ||
851 | gboolean year_left; | ||
852 | |||
853 | widget->allocation = *allocation; | ||
854 | @@ -1569,58 +1761,24 @@ | ||
855 | } | ||
856 | else | ||
857 | { | ||
858 | - private_data->day_width = (allocation->width | ||
859 | + private_data->day_width = (allocation->width | ||
860 | - (xthickness + INNER_BORDER) * 2 | ||
861 | - (CALENDAR_MARGIN * 2) | ||
862 | - (DAY_XSEP * 6))/7; | ||
863 | private_data->week_width = 0; | ||
864 | } | ||
865 | - | ||
866 | + | ||
867 | if (GTK_WIDGET_REALIZED (widget)) | ||
868 | { | ||
869 | gdk_window_move_resize (widget->window, | ||
870 | - allocation->x, allocation->y, | ||
871 | - allocation->width, allocation->height); | ||
872 | + widget->allocation.x, widget->allocation.y, | ||
873 | + widget->allocation.width, widget->allocation.height); | ||
874 | if (private_data->header_win) | ||
875 | gdk_window_move_resize (private_data->header_win, | ||
876 | - xthickness, ythickness, | ||
877 | - allocation->width - 2 * xthickness, private_data->header_h); | ||
878 | - if (private_data->arrow_win[ARROW_MONTH_LEFT]) | ||
879 | - { | ||
880 | - if (year_left) | ||
881 | - gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_LEFT], | ||
882 | - (allocation->width - 2 * xthickness | ||
883 | - - (3 + 2*private_data->arrow_width | ||
884 | - + private_data->max_month_width)), | ||
885 | - 3, | ||
886 | - private_data->arrow_width, | ||
887 | - private_data->header_h - 7); | ||
888 | - else | ||
889 | - gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_LEFT], | ||
890 | - 3, 3, | ||
891 | - private_data->arrow_width, | ||
892 | - private_data->header_h - 7); | ||
893 | - } | ||
894 | - if (private_data->arrow_win[ARROW_MONTH_RIGHT]) | ||
895 | - { | ||
896 | - if (year_left) | ||
897 | - gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_RIGHT], | ||
898 | - (allocation->width - 2 * xthickness | ||
899 | - - 3 - private_data->arrow_width), | ||
900 | - 3, | ||
901 | - private_data->arrow_width, | ||
902 | - private_data->header_h - 7); | ||
903 | - else | ||
904 | - gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_RIGHT], | ||
905 | - (private_data->arrow_width | ||
906 | - + private_data->max_month_width), | ||
907 | - 3, | ||
908 | - private_data->arrow_width, | ||
909 | - private_data->header_h - 7); | ||
910 | - } | ||
911 | + 0, 0, widget->allocation.width, HILDON_ARROW_HEIGHT); | ||
912 | if (private_data->arrow_win[ARROW_YEAR_LEFT]) | ||
913 | { | ||
914 | - if (year_left) | ||
915 | + /* if (year_left) | ||
916 | gdk_window_move_resize (private_data->arrow_win[ARROW_YEAR_LEFT], | ||
917 | 3, 3, | ||
918 | private_data->arrow_width, | ||
919 | @@ -1632,11 +1790,14 @@ | ||
920 | + private_data->max_year_width)), | ||
921 | 3, | ||
922 | private_data->arrow_width, | ||
923 | - private_data->header_h - 7); | ||
924 | + private_data->header_h - 7);*/ | ||
925 | + | ||
926 | + gdk_window_move (private_data->arrow_win[ARROW_YEAR_LEFT], | ||
927 | + (widget->allocation.width - private_data->max_year_width) / 2 - HILDON_ARROW_WIDTH - HILDON_ARROW_SEP, 0); | ||
928 | } | ||
929 | if (private_data->arrow_win[ARROW_YEAR_RIGHT]) | ||
930 | { | ||
931 | - if (year_left) | ||
932 | +/* if (year_left) | ||
933 | gdk_window_move_resize (private_data->arrow_win[ARROW_YEAR_RIGHT], | ||
934 | (private_data->arrow_width | ||
935 | + private_data->max_year_width), | ||
936 | @@ -1649,55 +1810,102 @@ | ||
937 | - 3 - private_data->arrow_width), | ||
938 | 3, | ||
939 | private_data->arrow_width, | ||
940 | + private_data->header_h - 7);*/ | ||
941 | + gdk_window_move (private_data->arrow_win[ARROW_YEAR_RIGHT], | ||
942 | + (widget->allocation.width + private_data->max_year_width) / 2 + HILDON_ARROW_SEP, 0); | ||
943 | + } | ||
944 | + if (private_data->footer_win) | ||
945 | + gdk_window_move_resize (private_data->footer_win, | ||
946 | + 0, private_data->header_h + private_data->day_name_h + private_data->main_h + CALENDAR_YSEP, | ||
947 | + widget->allocation.width, HILDON_ARROW_HEIGHT); | ||
948 | + | ||
949 | + if (private_data->arrow_win[ARROW_MONTH_LEFT]) | ||
950 | + { | ||
951 | +/* if (year_left) | ||
952 | + gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_LEFT], | ||
953 | + (allocation->width - 2 * xthickness | ||
954 | + - (3 + 2*private_data->arrow_width | ||
955 | + + private_data->max_month_width)), | ||
956 | + 3, | ||
957 | + private_data->arrow_width, | ||
958 | private_data->header_h - 7); | ||
959 | + else | ||
960 | + gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_LEFT], | ||
961 | + 3, 3, | ||
962 | + private_data->arrow_width, | ||
963 | + private_data->header_h - 7); | ||
964 | +*/ | ||
965 | + | ||
966 | + gdk_window_move (private_data->arrow_win[ARROW_MONTH_LEFT], | ||
967 | + (widget->allocation.width - private_data->max_month_width) / 2 - HILDON_ARROW_WIDTH - HILDON_ARROW_SEP, 0); | ||
968 | + } | ||
969 | + if (private_data->arrow_win[ARROW_MONTH_RIGHT]) | ||
970 | + { | ||
971 | +/* if (year_left) | ||
972 | + gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_RIGHT], | ||
973 | + (allocation->width - 2 * xthickness | ||
974 | + - 3 - private_data->arrow_width), | ||
975 | + 3, | ||
976 | + private_data->arrow_width, | ||
977 | + private_data->header_h - 7); | ||
978 | + else | ||
979 | + gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_RIGHT], | ||
980 | + (private_data->arrow_width | ||
981 | + + private_data->max_month_width), | ||
982 | + 3, | ||
983 | + private_data->arrow_width, | ||
984 | + private_data->header_h - 7);*/ | ||
985 | + gdk_window_move (private_data->arrow_win[ARROW_MONTH_RIGHT], | ||
986 | + (widget->allocation.width + private_data->max_month_width) / 2 + HILDON_ARROW_SEP, 0); | ||
987 | } | ||
988 | + | ||
989 | + | ||
990 | if (private_data->day_name_win) | ||
991 | gdk_window_move_resize (private_data->day_name_win, | ||
992 | - xthickness + INNER_BORDER, | ||
993 | - private_data->header_h + (widget->style->ythickness + INNER_BORDER), | ||
994 | - allocation->width - (xthickness + INNER_BORDER) * 2, | ||
995 | + private_data->week_width, /*xthickness + INNER_BORDER*/ | ||
996 | + private_data->header_h /*+ (widget->style->ythickness + INNER_BORDER)*/, | ||
997 | + widget->allocation.width - private_data->week_width /*- (xthickness + INNER_BORDER) * 2*/, | ||
998 | private_data->day_name_h); | ||
999 | if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) | ||
1000 | { | ||
1001 | if (private_data->week_win) | ||
1002 | gdk_window_move_resize (private_data->week_win, | ||
1003 | - (xthickness + INNER_BORDER), | ||
1004 | - private_data->header_h + private_data->day_name_h | ||
1005 | - + (widget->style->ythickness + INNER_BORDER), | ||
1006 | - private_data->week_width, | ||
1007 | - private_data->main_h); | ||
1008 | + 0 /*(xthickness + INNER_BORDER)*/, | ||
1009 | + private_data->header_h /*+ (widget->style->ythickness + INNER_BORDER)*/, | ||
1010 | + HILDON_DAY_WIDTH, | ||
1011 | + private_data->main_h + private_data->day_name_h); | ||
1012 | gdk_window_move_resize (private_data->main_win, | ||
1013 | - private_data->week_width + (xthickness + INNER_BORDER), | ||
1014 | + private_data->week_width /* + (xthickness + INNER_BORDER)*/, | ||
1015 | private_data->header_h + private_data->day_name_h | ||
1016 | - + (widget->style->ythickness + INNER_BORDER), | ||
1017 | - allocation->width | ||
1018 | - - private_data->week_width | ||
1019 | - - (xthickness + INNER_BORDER) * 2, | ||
1020 | + /*+ (widget->style->ythickness + INNER_BORDER)*/, | ||
1021 | + widget->allocation.width - private_data->week_width | ||
1022 | + /*- (xthickness + INNER_BORDER) * 2*/, | ||
1023 | private_data->main_h); | ||
1024 | } | ||
1025 | else | ||
1026 | { | ||
1027 | gdk_window_move_resize (private_data->main_win, | ||
1028 | - (xthickness + INNER_BORDER), | ||
1029 | + 0 /*(xthickness + INNER_BORDER)*/, | ||
1030 | private_data->header_h + private_data->day_name_h | ||
1031 | - + (widget->style->ythickness + INNER_BORDER), | ||
1032 | - allocation->width | ||
1033 | + /*+ (widget->style->ythickness + INNER_BORDER)*/, | ||
1034 | + widget->allocation.width | ||
1035 | - private_data->week_width | ||
1036 | - - (xthickness + INNER_BORDER) * 2, | ||
1037 | + /*- (xthickness + INNER_BORDER) * 2*/, | ||
1038 | private_data->main_h); | ||
1039 | if (private_data->week_win) | ||
1040 | gdk_window_move_resize (private_data->week_win, | ||
1041 | - allocation->width | ||
1042 | + widget->allocation.width | ||
1043 | - private_data->week_width | ||
1044 | - - (xthickness + INNER_BORDER), | ||
1045 | + /*- (xthickness + INNER_BORDER)*/, | ||
1046 | private_data->header_h + private_data->day_name_h | ||
1047 | - + (widget->style->ythickness + INNER_BORDER), | ||
1048 | + /*+ (widget->style->ythickness + INNER_BORDER)*/, | ||
1049 | private_data->week_width, | ||
1050 | private_data->main_h); | ||
1051 | } | ||
1052 | } | ||
1053 | } | ||
1054 | |||
1055 | + | ||
1056 | static gboolean | ||
1057 | gtk_calendar_expose (GtkWidget *widget, | ||
1058 | GdkEventExpose *event) | ||
1059 | @@ -1711,22 +1919,24 @@ | ||
1060 | if (GTK_WIDGET_DRAWABLE (widget)) | ||
1061 | { | ||
1062 | if (event->window == private_data->main_win) | ||
1063 | - gtk_calendar_paint_main (widget); | ||
1064 | + gtk_calendar_paint_main (widget); | ||
1065 | |||
1066 | if (event->window == private_data->header_win) | ||
1067 | - gtk_calendar_paint_header (widget); | ||
1068 | - | ||
1069 | - if (event->window == private_data->day_name_win) | ||
1070 | - gtk_calendar_paint_day_names (widget); | ||
1071 | - | ||
1072 | - if (event->window == private_data->week_win) | ||
1073 | - gtk_calendar_paint_week_numbers (widget); | ||
1074 | - if (event->window == widget->window) | ||
1075 | + gtk_calendar_paint_header (widget); | ||
1076 | + if (event->window == private_data->footer_win) | ||
1077 | + gtk_calendar_paint_footer(widget); | ||
1078 | + | ||
1079 | + if (event->window == private_data->day_name_win) | ||
1080 | + gtk_calendar_paint_day_names (widget); | ||
1081 | + | ||
1082 | + if (event->window == private_data->week_win) | ||
1083 | + gtk_calendar_paint_week_numbers (widget); | ||
1084 | +/* if (event->window == widget->window) | ||
1085 | { | ||
1086 | gtk_paint_shadow (widget->style, widget->window, GTK_WIDGET_STATE (widget), | ||
1087 | GTK_SHADOW_IN, NULL, widget, "calendar", | ||
1088 | 0, 0, widget->allocation.width, widget->allocation.height); | ||
1089 | - } | ||
1090 | + }*/ | ||
1091 | } | ||
1092 | |||
1093 | return FALSE; | ||
1094 | @@ -1740,12 +1950,12 @@ | ||
1095 | char buffer[255]; | ||
1096 | int x, y; | ||
1097 | gint header_width, cal_height; | ||
1098 | - gint max_month_width; | ||
1099 | +/* gint max_month_width;*/ | ||
1100 | gint max_year_width; | ||
1101 | GtkCalendarPrivateData *private_data; | ||
1102 | PangoLayout *layout; | ||
1103 | PangoRectangle logical_rect; | ||
1104 | - gboolean year_left; | ||
1105 | +/* gboolean year_left;*/ | ||
1106 | |||
1107 | calendar = GTK_CALENDAR (widget); | ||
1108 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1109 | @@ -1755,29 +1965,29 @@ | ||
1110 | private_data->dirty_header = 1; | ||
1111 | return; | ||
1112 | } | ||
1113 | - | ||
1114 | +/* | ||
1115 | if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) | ||
1116 | year_left = private_data->year_before; | ||
1117 | else | ||
1118 | year_left = !private_data->year_before; | ||
1119 | - | ||
1120 | +*/ | ||
1121 | private_data->dirty_header = 0; | ||
1122 | gc = calendar->gc; | ||
1123 | |||
1124 | /* Clear window */ | ||
1125 | gdk_window_clear (private_data->header_win); | ||
1126 | |||
1127 | - header_width = widget->allocation.width - 2 * widget->style->xthickness; | ||
1128 | + header_width = widget->allocation.width /*- 2 * widget->style->xthickness*/; | ||
1129 | cal_height = widget->allocation.height; | ||
1130 | |||
1131 | - max_month_width = private_data->max_month_width; | ||
1132 | + /*max_month_width = private_data->max_month_width;*/ | ||
1133 | max_year_width = private_data->max_year_width; | ||
1134 | |||
1135 | - gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar))); | ||
1136 | - gtk_paint_shadow (widget->style, private_data->header_win, | ||
1137 | +/* gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar)));*/ | ||
1138 | + /*gtk_paint_shadow (widget->style, private_data->header_win, | ||
1139 | GTK_STATE_NORMAL, GTK_SHADOW_OUT, | ||
1140 | NULL, widget, "calendar", | ||
1141 | - 0, 0, header_width, private_data->header_h); | ||
1142 | + 0, 0, header_width, private_data->header_h);*/ | ||
1143 | |||
1144 | |||
1145 | g_snprintf (buffer, sizeof (buffer), "%d", calendar->year); | ||
1146 | @@ -1785,55 +1995,118 @@ | ||
1147 | pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
1148 | |||
1149 | /* Draw title */ | ||
1150 | - y = (private_data->header_h - logical_rect.height) / 2; | ||
1151 | - | ||
1152 | + y = (HILDON_ARROW_HEIGHT /*private_data->header_h*/ - logical_rect.height) / 2; | ||
1153 | + x = (widget->allocation.width - logical_rect.width) / 2; | ||
1154 | + | ||
1155 | /* Draw year and its arrows */ | ||
1156 | - | ||
1157 | +#if 0 | ||
1158 | if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE) | ||
1159 | - if (year_left) | ||
1160 | - x = 3 + (max_year_width - logical_rect.width)/2; | ||
1161 | - else | ||
1162 | +/* if (year_left) */ | ||
1163 | + x = /*3+*/(widget->allocation.width - logical_rect.width)/2; | ||
1164 | +/* else | ||
1165 | x = header_width - (3 + max_year_width | ||
1166 | - - (max_year_width - logical_rect.width)/2); | ||
1167 | + - (max_year_width - logical_rect.width)/2);*/ | ||
1168 | else | ||
1169 | - if (year_left) | ||
1170 | - x = 3 + private_data->arrow_width + (max_year_width - logical_rect.width)/2; | ||
1171 | - else | ||
1172 | +/* if (year_left)*/ | ||
1173 | + x = 3 + HILDON_ARROW_WIDTH /*private_data->arrow_width*/ + (max_year_width - logical_rect.width)/2; | ||
1174 | + /* else | ||
1175 | x = header_width - (3 + private_data->arrow_width + max_year_width | ||
1176 | - (max_year_width - logical_rect.width)/2); | ||
1177 | + */ | ||
1178 | + #endif | ||
1179 | + gdk_gc_set_foreground (gc, HEADER_FG_COLOR (GTK_WIDGET (calendar))); | ||
1180 | + gdk_draw_layout (private_data->header_win, gc, x, y, layout); | ||
1181 | + | ||
1182 | + gtk_calendar_paint_arrow (widget, ARROW_YEAR_LEFT); | ||
1183 | + gtk_calendar_paint_arrow (widget, ARROW_YEAR_RIGHT); | ||
1184 | + | ||
1185 | + g_object_unref (layout); | ||
1186 | +} | ||
1187 | + | ||
1188 | +static void | ||
1189 | +gtk_calendar_paint_footer (GtkWidget *widget) | ||
1190 | +{ | ||
1191 | +GtkCalendar *calendar; | ||
1192 | + GdkGC *gc; | ||
1193 | + char buffer[255]; | ||
1194 | + int x, y; | ||
1195 | + gint header_width, cal_height; | ||
1196 | +/* gint max_month_width; | ||
1197 | + gint max_year_width;*/ | ||
1198 | + GtkCalendarPrivateData *private_data; | ||
1199 | + PangoLayout *layout; | ||
1200 | + PangoRectangle logical_rect; | ||
1201 | +/* gboolean year_left;*/ | ||
1202 | + | ||
1203 | + calendar = GTK_CALENDAR (widget); | ||
1204 | + private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1205 | + | ||
1206 | + if (private_data->freeze_count) | ||
1207 | + { | ||
1208 | + private_data->dirty_header = 1; | ||
1209 | + return; | ||
1210 | + } | ||
1211 | +/* | ||
1212 | + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) | ||
1213 | + year_left = private_data->year_before; | ||
1214 | + else | ||
1215 | + year_left = !private_data->year_before; | ||
1216 | +*/ | ||
1217 | + private_data->dirty_header = 0; | ||
1218 | + gc = calendar->gc; | ||
1219 | |||
1220 | + /* Clear window */ | ||
1221 | + gdk_window_clear (private_data->footer_win); | ||
1222 | + | ||
1223 | + header_width = widget->allocation.width - 2 * widget->style->xthickness; | ||
1224 | + cal_height = widget->allocation.height; | ||
1225 | + | ||
1226 | + /*max_month_width = private_data->max_month_width;*/ | ||
1227 | + /*max_year_width = private_data->max_year_width;*/ | ||
1228 | + | ||
1229 | + /*gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar)));*/ | ||
1230 | + /*gtk_paint_shadow (widget->style, private_data->footer_win, | ||
1231 | + GTK_STATE_NORMAL, GTK_SHADOW_OUT, | ||
1232 | + NULL, widget, "calendar", | ||
1233 | + 0, 0, header_width, private_data->header_h);*/ | ||
1234 | |||
1235 | - gdk_gc_set_foreground (gc, HEADER_FG_COLOR (GTK_WIDGET (calendar))); | ||
1236 | - gdk_draw_layout (private_data->header_win, gc, x, y, layout); | ||
1237 | |||
1238 | + /*g_snprintf (buffer, sizeof (buffer), "%d", calendar->year);*/ | ||
1239 | + | ||
1240 | +/* pango_layout_get_pixel_extents (layout, NULL, &logical_rect);*/ | ||
1241 | + | ||
1242 | + /* Draw title */ | ||
1243 | + | ||
1244 | + | ||
1245 | /* Draw month */ | ||
1246 | g_snprintf (buffer, sizeof (buffer), "%s", default_monthname[calendar->month]); | ||
1247 | - pango_layout_set_text (layout, buffer, -1); | ||
1248 | + layout = gtk_widget_create_pango_layout (widget, buffer); | ||
1249 | pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
1250 | - | ||
1251 | +#if 0 | ||
1252 | if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE) | ||
1253 | - if (year_left) | ||
1254 | +/* if (year_left)*/ | ||
1255 | x = header_width - (3 + max_month_width | ||
1256 | - (max_month_width - logical_rect.width)/2); | ||
1257 | - else | ||
1258 | - x = 3 + (max_month_width - logical_rect.width) / 2; | ||
1259 | + /* else | ||
1260 | + x = 3 + (max_month_width - logical_rect.width) / 2;*/ | ||
1261 | else | ||
1262 | - if (year_left) | ||
1263 | - x = header_width - (3 + private_data->arrow_width + max_month_width | ||
1264 | +/* if (year_left)*/ | ||
1265 | + x = header_width - (3 + HILDON_ARROW_WIDTH /*private_data->arrow_width*/ + max_month_width | ||
1266 | - (max_month_width - logical_rect.width)/2); | ||
1267 | - else | ||
1268 | +/* else | ||
1269 | x = 3 + private_data->arrow_width + (max_month_width - logical_rect.width)/2; | ||
1270 | +*/ | ||
1271 | +#endif | ||
1272 | + x = (widget->allocation.width - logical_rect.width) / 2; | ||
1273 | + y = (HILDON_ARROW_HEIGHT - logical_rect.height) / 2; | ||
1274 | + | ||
1275 | + gdk_gc_set_foreground (gc, HEADER_FG_COLOR(GTK_WIDGET (calendar))); | ||
1276 | + gdk_draw_layout (private_data->footer_win, gc, x, y, layout); | ||
1277 | |||
1278 | - gdk_draw_layout (private_data->header_win, gc, x, y, layout); | ||
1279 | - | ||
1280 | - gdk_gc_set_foreground (gc, BACKGROUND_COLOR (GTK_WIDGET (calendar))); | ||
1281 | - | ||
1282 | gtk_calendar_paint_arrow (widget, ARROW_MONTH_LEFT); | ||
1283 | gtk_calendar_paint_arrow (widget, ARROW_MONTH_RIGHT); | ||
1284 | - gtk_calendar_paint_arrow (widget, ARROW_YEAR_LEFT); | ||
1285 | - gtk_calendar_paint_arrow (widget, ARROW_YEAR_RIGHT); | ||
1286 | |||
1287 | - g_object_unref (layout); | ||
1288 | + g_object_unref(layout); | ||
1289 | } | ||
1290 | |||
1291 | static void | ||
1292 | @@ -1851,15 +2124,17 @@ | ||
1293 | GtkCalendarPrivateData *private_data; | ||
1294 | gint focus_padding; | ||
1295 | gint focus_width; | ||
1296 | + gboolean hildonlike; | ||
1297 | |||
1298 | g_return_if_fail (GTK_IS_CALENDAR (widget)); | ||
1299 | calendar = GTK_CALENDAR (widget); | ||
1300 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1301 | gc = calendar->gc; | ||
1302 | - | ||
1303 | + | ||
1304 | gtk_widget_style_get (GTK_WIDGET (widget), | ||
1305 | "focus-line-width", &focus_width, | ||
1306 | "focus-padding", &focus_padding, | ||
1307 | + "hildonlike", &hildonlike, | ||
1308 | NULL); | ||
1309 | /* | ||
1310 | * Handle freeze/thaw functionality | ||
1311 | @@ -1887,18 +2162,22 @@ | ||
1312 | * Draw rectangles as inverted background for the labels. | ||
1313 | */ | ||
1314 | |||
1315 | - gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget)); | ||
1316 | - gdk_draw_rectangle (private_data->day_name_win, gc, TRUE, | ||
1317 | - CALENDAR_MARGIN, CALENDAR_MARGIN, | ||
1318 | - cal_width-CALENDAR_MARGIN * 2, | ||
1319 | - private_data->day_name_h - CALENDAR_MARGIN); | ||
1320 | - | ||
1321 | - if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS) | ||
1322 | - gdk_draw_rectangle (private_data->day_name_win, gc, TRUE, | ||
1323 | - CALENDAR_MARGIN, | ||
1324 | - private_data->day_name_h - CALENDAR_YSEP, | ||
1325 | - private_data->week_width - CALENDAR_YSEP - CALENDAR_MARGIN, | ||
1326 | - CALENDAR_YSEP); | ||
1327 | + /* Hildon: don't paint dayname window */ | ||
1328 | + if (!hildonlike) | ||
1329 | + { | ||
1330 | + gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget)); | ||
1331 | + gdk_draw_rectangle (private_data->day_name_win, gc, TRUE, | ||
1332 | + CALENDAR_MARGIN, CALENDAR_MARGIN, | ||
1333 | + cal_width-CALENDAR_MARGIN * 2, | ||
1334 | + private_data->day_name_h - CALENDAR_MARGIN); | ||
1335 | + | ||
1336 | + if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS) | ||
1337 | + gdk_draw_rectangle (private_data->day_name_win, gc, TRUE, | ||
1338 | + CALENDAR_MARGIN, | ||
1339 | + private_data->day_name_h - CALENDAR_YSEP, | ||
1340 | + private_data->week_width - CALENDAR_YSEP - CALENDAR_MARGIN, | ||
1341 | + CALENDAR_YSEP); | ||
1342 | + } | ||
1343 | |||
1344 | /* | ||
1345 | * Write the labels | ||
1346 | @@ -1908,28 +2187,43 @@ | ||
1347 | |||
1348 | gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (widget)); | ||
1349 | for (i = 0; i < 7; i++) | ||
1350 | - { | ||
1351 | + { | ||
1352 | if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL) | ||
1353 | - day = 6 - i; | ||
1354 | + day = 6 - i; | ||
1355 | else | ||
1356 | - day = i; | ||
1357 | - day = (day + private_data->week_start) % 7; | ||
1358 | - g_snprintf (buffer, sizeof (buffer), "%s", default_abbreviated_dayname[day]); | ||
1359 | + day = i; | ||
1360 | + day = (day + private_data->week_start) % 7; | ||
1361 | + g_snprintf (buffer, sizeof (buffer), "%s", default_abbreviated_dayname[day]); | ||
1362 | + | ||
1363 | + pango_layout_set_text (layout, buffer, -1); | ||
1364 | + pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
1365 | |||
1366 | - pango_layout_set_text (layout, buffer, -1); | ||
1367 | - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
1368 | + /* Hildon: draw passive focus for day name */ | ||
1369 | + if (hildonlike && calendar->focus_col == i) | ||
1370 | + { | ||
1371 | + guint x = left_x_for_column (calendar, calendar->focus_col); | ||
1372 | |||
1373 | - gdk_draw_layout (private_data->day_name_win, gc, | ||
1374 | - (CALENDAR_MARGIN + | ||
1375 | - + (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ? | ||
1376 | - (private_data->week_width + (private_data->week_width ? CALENDAR_XSEP : 0)) | ||
1377 | - : 0) | ||
1378 | - + day_wid_sep * i | ||
1379 | - + (day_width - logical_rect.width)/2), | ||
1380 | - CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y, | ||
1381 | - layout); | ||
1382 | + gtk_paint_box( GTK_WIDGET (calendar)->style, | ||
1383 | + private_data->day_name_win, | ||
1384 | + GTK_STATE_NORMAL, | ||
1385 | + GTK_SHADOW_OUT, NULL, | ||
1386 | + GTK_WIDGET (calendar), "passive-focus", | ||
1387 | + (x + 4) + HILDON_DAY_WIDTH, 0, | ||
1388 | + day_wid_sep + 2, | ||
1389 | + HILDON_DAY_HEIGHT); | ||
1390 | + } | ||
1391 | + gdk_draw_layout (private_data->day_name_win, gc, | ||
1392 | + (CALENDAR_MARGIN + | ||
1393 | + + (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ? | ||
1394 | + (private_data->week_width + (private_data->week_width ? CALENDAR_XSEP : 0)) | ||
1395 | + : 0) | ||
1396 | + + day_wid_sep * i | ||
1397 | + + (day_width - logical_rect.width)/2), | ||
1398 | + CALENDAR_MARGIN + focus_width + focus_padding + logical_rect.y, | ||
1399 | + layout); | ||
1400 | + | ||
1401 | + | ||
1402 | } | ||
1403 | - | ||
1404 | g_object_unref (layout); | ||
1405 | } | ||
1406 | |||
1407 | @@ -1940,14 +2234,15 @@ | ||
1408 | GdkGC *gc; | ||
1409 | gint row, week = 0, year; | ||
1410 | gint x_loc; | ||
1411 | - char buffer[3]; | ||
1412 | - gint y_loc, day_height; | ||
1413 | + char buffer[10]; | ||
1414 | + gint y_loc /*, day_height*/; | ||
1415 | GtkCalendarPrivateData *private_data; | ||
1416 | PangoLayout *layout; | ||
1417 | PangoRectangle logical_rect; | ||
1418 | gint focus_padding; | ||
1419 | gint focus_width; | ||
1420 | - | ||
1421 | + gboolean hildonlike; | ||
1422 | + | ||
1423 | g_return_if_fail (GTK_IS_CALENDAR (widget)); | ||
1424 | g_return_if_fail (widget->window != NULL); | ||
1425 | calendar = GTK_CALENDAR (widget); | ||
1426 | @@ -1968,6 +2263,7 @@ | ||
1427 | gtk_widget_style_get (GTK_WIDGET (widget), | ||
1428 | "focus-line-width", &focus_width, | ||
1429 | "focus-padding", &focus_padding, | ||
1430 | + "hildonlike", &hildonlike, | ||
1431 | NULL); | ||
1432 | |||
1433 | /* | ||
1434 | @@ -1981,18 +2277,23 @@ | ||
1435 | */ | ||
1436 | |||
1437 | gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (widget)); | ||
1438 | - if (private_data->day_name_win) | ||
1439 | - gdk_draw_rectangle (private_data->week_win, gc, TRUE, | ||
1440 | - CALENDAR_MARGIN, | ||
1441 | - 0, | ||
1442 | - private_data->week_width - CALENDAR_MARGIN, | ||
1443 | - private_data->main_h - CALENDAR_MARGIN); | ||
1444 | - else | ||
1445 | - gdk_draw_rectangle (private_data->week_win, gc, TRUE, | ||
1446 | - CALENDAR_MARGIN, | ||
1447 | - CALENDAR_MARGIN, | ||
1448 | - private_data->week_width - CALENDAR_MARGIN, | ||
1449 | - private_data->main_h - 2 * CALENDAR_MARGIN); | ||
1450 | + | ||
1451 | + /* Hildon: don't paint background for weekday window */ | ||
1452 | + if (!hildonlike) | ||
1453 | + { | ||
1454 | + if (private_data->day_name_win) | ||
1455 | + gdk_draw_rectangle (private_data->week_win, gc, TRUE, | ||
1456 | + CALENDAR_MARGIN, | ||
1457 | + 0, | ||
1458 | + private_data->week_width - CALENDAR_MARGIN, | ||
1459 | + private_data->main_h + private_data->day_name_h- CALENDAR_MARGIN); | ||
1460 | + else | ||
1461 | + gdk_draw_rectangle (private_data->week_win, gc, TRUE, | ||
1462 | + CALENDAR_MARGIN, | ||
1463 | + CALENDAR_MARGIN, | ||
1464 | + private_data->week_width - CALENDAR_MARGIN, | ||
1465 | + private_data->main_h - 2 * CALENDAR_MARGIN); | ||
1466 | + } | ||
1467 | |||
1468 | /* | ||
1469 | * Write the labels | ||
1470 | @@ -2001,10 +2302,13 @@ | ||
1471 | layout = gtk_widget_create_pango_layout (widget, NULL); | ||
1472 | |||
1473 | gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (widget)); | ||
1474 | - day_height = row_height (calendar); | ||
1475 | + gdk_draw_line(private_data->week_win, gc, | ||
1476 | + HILDON_DAY_WIDTH - 1, 0, HILDON_DAY_WIDTH - 1, private_data->main_h + private_data->day_name_h); | ||
1477 | + | ||
1478 | + /*day_height = row_height (calendar)*/; | ||
1479 | for (row = 0; row < 6; row++) | ||
1480 | { | ||
1481 | - year = calendar->year; | ||
1482 | + year = calendar->year; | ||
1483 | if (calendar->day[row][6] < 15 && row > 3 && calendar->month == 11) | ||
1484 | year++; | ||
1485 | |||
1486 | @@ -2012,15 +2316,30 @@ | ||
1487 | ((calendar->day[row][6] < 15 && row > 3 ? 1 : 0) | ||
1488 | + calendar->month) % 12 + 1, calendar->day[row][6])); | ||
1489 | |||
1490 | - g_snprintf (buffer, sizeof (buffer), "%d", week); | ||
1491 | - pango_layout_set_text (layout, buffer, -1); | ||
1492 | - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
1493 | - | ||
1494 | - y_loc = top_y_for_row (calendar, row) + (day_height - logical_rect.height) / 2; | ||
1495 | - | ||
1496 | - x_loc = (private_data->week_width | ||
1497 | + g_snprintf (buffer, sizeof (buffer), "%d", week); | ||
1498 | + pango_layout_set_text (layout, buffer, -1); | ||
1499 | + pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
1500 | + | ||
1501 | + /* Hildon: draw passive focus for week */ | ||
1502 | + if (hildonlike && calendar->focus_row == row) | ||
1503 | + { | ||
1504 | + guint y = top_y_for_row (calendar, calendar->focus_row + 1); | ||
1505 | + | ||
1506 | + gtk_paint_box( GTK_WIDGET (calendar)->style, | ||
1507 | + private_data->week_win, | ||
1508 | + GTK_STATE_NORMAL, | ||
1509 | + GTK_SHADOW_OUT, NULL, | ||
1510 | + GTK_WIDGET (calendar), "passive-focus", | ||
1511 | + 0, y, | ||
1512 | + private_data->week_width - 4, | ||
1513 | + HILDON_DAY_HEIGHT); | ||
1514 | + } | ||
1515 | + | ||
1516 | + y_loc = private_data->day_name_h + top_y_for_row (calendar, row) + (HILDON_DAY_HEIGHT - logical_rect.height) / 2; | ||
1517 | + x_loc = (HILDON_DAY_WIDTH - logical_rect.width) / 2; | ||
1518 | + /*(private_data->week_width | ||
1519 | - logical_rect.width | ||
1520 | - - CALENDAR_XSEP - focus_padding - focus_width); | ||
1521 | + - CALENDAR_XSEP - focus_padding - focus_width);*/ | ||
1522 | |||
1523 | gdk_draw_layout (private_data->week_win, gc, x_loc, y_loc, layout); | ||
1524 | } | ||
1525 | @@ -2034,11 +2353,13 @@ | ||
1526 | { | ||
1527 | GtkCalendar *calendar; | ||
1528 | gint r, c, row, col; | ||
1529 | - | ||
1530 | + GtkCalendarPrivateData *private_data; | ||
1531 | g_return_if_fail (GTK_IS_CALENDAR (widget)); | ||
1532 | |||
1533 | calendar = GTK_CALENDAR (widget); | ||
1534 | - | ||
1535 | + | ||
1536 | + private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1537 | + | ||
1538 | row = -1; | ||
1539 | col = -1; | ||
1540 | for (r = 0; r < 6; r++) | ||
1541 | @@ -2054,6 +2375,7 @@ | ||
1542 | g_return_if_fail (col != -1); | ||
1543 | |||
1544 | gtk_calendar_paint_day (widget, row, col); | ||
1545 | + | ||
1546 | } | ||
1547 | |||
1548 | static void | ||
1549 | @@ -2065,13 +2387,14 @@ | ||
1550 | GdkGC *gc; | ||
1551 | gchar buffer[255]; | ||
1552 | gint day; | ||
1553 | - gint day_height; | ||
1554 | + /*gint day_height;*/ | ||
1555 | gint x_left; | ||
1556 | gint x_loc; | ||
1557 | gint y_top; | ||
1558 | gint y_loc; | ||
1559 | - gint day_xspace; | ||
1560 | + /*gint day_xspace;*/ | ||
1561 | gint focus_width; | ||
1562 | + gboolean hildonlike; | ||
1563 | |||
1564 | GtkCalendarPrivateData *private_data; | ||
1565 | PangoLayout *layout; | ||
1566 | @@ -2083,6 +2406,8 @@ | ||
1567 | calendar = GTK_CALENDAR (widget); | ||
1568 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1569 | |||
1570 | + if (private_data->main_win == NULL) return; | ||
1571 | + | ||
1572 | /* | ||
1573 | * Handle freeze/thaw functionality | ||
1574 | */ | ||
1575 | @@ -2092,25 +2417,25 @@ | ||
1576 | private_data->dirty_main = 1; | ||
1577 | return; | ||
1578 | } | ||
1579 | - | ||
1580 | - gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL); | ||
1581 | |||
1582 | - day_height = row_height (calendar); | ||
1583 | - | ||
1584 | - day_xspace = private_data->day_width - private_data->max_day_char_width*2; | ||
1585 | + gtk_widget_style_get (widget, "focus-line-width", &focus_width, | ||
1586 | + "hildonlike", &hildonlike, NULL); | ||
1587 | + | ||
1588 | + /*day_height = row_height (calendar)*/; | ||
1589 | + /*day_xspace = HILDON_DAY_WIDTH private_data->day_width - private_data->max_day_char_width*2*/; | ||
1590 | |||
1591 | day = calendar->day[row][col]; | ||
1592 | - | ||
1593 | + | ||
1594 | x_left = left_x_for_column (calendar, col); | ||
1595 | - x_loc = x_left + private_data->day_width / 2 + private_data->max_day_char_width; | ||
1596 | + /*x_loc = x_left + private_data->day_width / 2 + private_data->max_day_char_width;*/ | ||
1597 | |||
1598 | y_top = top_y_for_row (calendar, row); | ||
1599 | |||
1600 | gdk_window_clear_area (private_data->main_win, x_left, y_top, | ||
1601 | - private_data->day_width, day_height); | ||
1602 | + HILDON_DAY_WIDTH, HILDON_DAY_HEIGHT); | ||
1603 | |||
1604 | gc = calendar->gc; | ||
1605 | - | ||
1606 | + | ||
1607 | if (calendar->day_month[row][col] == MONTH_PREV) | ||
1608 | { | ||
1609 | gdk_gc_set_foreground (gc, PREV_MONTH_COLOR (GTK_WIDGET (calendar))); | ||
1610 | @@ -2123,44 +2448,43 @@ | ||
1611 | { | ||
1612 | /* | ||
1613 | if (calendar->highlight_row == row && calendar->highlight_col == col) | ||
1614 | - { | ||
1615 | - gdk_gc_set_foreground (gc, HIGHLIGHT_BACK_COLOR (GTK_WIDGET (calendar))); | ||
1616 | - gdk_draw_rectangle (private_data->main_win, gc, TRUE, x_left, y_top, | ||
1617 | + { | ||
1618 | + gdk_gc_set_foreground (gc, HIGHLIGHT_BACK_COLOR (GTK_WIDGET (calendar))); | ||
1619 | + gdk_draw_rectangle (private_data->main_win, gc, TRUE, x_left, y_top, | ||
1620 | private_data->day_width, day_height); | ||
1621 | - } | ||
1622 | + } | ||
1623 | */ | ||
1624 | if (calendar->selected_day == day) | ||
1625 | - { | ||
1626 | - gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (GTK_WIDGET (calendar))); | ||
1627 | - gdk_draw_rectangle (private_data->main_win, gc, TRUE, x_left, y_top, | ||
1628 | - private_data->day_width, day_height); | ||
1629 | - } | ||
1630 | - | ||
1631 | + { | ||
1632 | + /* Hildon: use custom graphics */ | ||
1633 | + if (hildonlike) | ||
1634 | + { | ||
1635 | + gtk_paint_box( GTK_WIDGET (calendar)->style, | ||
1636 | + private_data->main_win, | ||
1637 | + GTK_STATE_NORMAL, | ||
1638 | + GTK_SHADOW_NONE, NULL, | ||
1639 | + GTK_WIDGET (calendar), "active-day", | ||
1640 | + x_left, y_top, | ||
1641 | + HILDON_DAY_WIDTH, | ||
1642 | + HILDON_DAY_HEIGHT); | ||
1643 | + } | ||
1644 | + else | ||
1645 | + { | ||
1646 | + gdk_gc_set_foreground (gc, SELECTED_BG_COLOR (GTK_WIDGET (calendar))); | ||
1647 | + gdk_draw_rectangle (private_data->main_win, gc, TRUE, x_left, y_top, | ||
1648 | + HILDON_DAY_WIDTH, HILDON_DAY_HEIGHT); | ||
1649 | + } | ||
1650 | + } | ||
1651 | if (calendar->marked_date[day-1]) | ||
1652 | - gdk_gc_set_foreground (gc, MARKED_COLOR (GTK_WIDGET (calendar))); | ||
1653 | + gdk_gc_set_foreground (gc, MARKED_COLOR (GTK_WIDGET (calendar))); | ||
1654 | else | ||
1655 | - gdk_gc_set_foreground (gc, NORMAL_DAY_COLOR (GTK_WIDGET (calendar))); | ||
1656 | - | ||
1657 | + gdk_gc_set_foreground (gc, NORMAL_DAY_COLOR (GTK_WIDGET (calendar))); | ||
1658 | if (calendar->selected_day == day) | ||
1659 | - gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (GTK_WIDGET (calendar))); | ||
1660 | + gdk_gc_set_foreground (gc, SELECTED_FG_COLOR (GTK_WIDGET (calendar))); | ||
1661 | else | ||
1662 | - gdk_gc_set_foreground (gc, & (GTK_WIDGET (calendar)->style->fg[GTK_WIDGET_STATE (calendar)])); | ||
1663 | - } | ||
1664 | - | ||
1665 | - | ||
1666 | - g_snprintf (buffer, sizeof (buffer), "%d", day); | ||
1667 | - layout = gtk_widget_create_pango_layout (widget, buffer); | ||
1668 | - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
1669 | + gdk_gc_set_foreground (gc, & (GTK_WIDGET (calendar)->style->fg[GTK_WIDGET_STATE (calendar)])); | ||
1670 | |||
1671 | - x_loc -= logical_rect.width; | ||
1672 | - | ||
1673 | - y_loc = y_top + (day_height - logical_rect.height) / 2; | ||
1674 | - gdk_draw_layout (private_data->main_win, gc, | ||
1675 | - x_loc, y_loc, layout); | ||
1676 | - if (calendar->marked_date[day-1] | ||
1677 | - && calendar->day_month[row][col] == MONTH_CURRENT) | ||
1678 | - gdk_draw_layout (private_data->main_win, gc, | ||
1679 | - x_loc-1, y_loc, layout); | ||
1680 | + } | ||
1681 | |||
1682 | if (GTK_WIDGET_HAS_FOCUS (calendar) | ||
1683 | && calendar->focus_row == row && calendar->focus_col == col) | ||
1684 | @@ -2168,9 +2492,9 @@ | ||
1685 | GtkStateType state; | ||
1686 | |||
1687 | if (calendar->selected_day == day) | ||
1688 | - state = GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE; | ||
1689 | + state = GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE; | ||
1690 | else | ||
1691 | - state = GTK_STATE_NORMAL; | ||
1692 | + state = GTK_STATE_NORMAL; | ||
1693 | |||
1694 | gtk_paint_focus (widget->style, | ||
1695 | private_data->main_win, | ||
1696 | @@ -2178,10 +2502,29 @@ | ||
1697 | ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, | ||
1698 | NULL, widget, "calendar-day", | ||
1699 | x_left, y_top, | ||
1700 | - private_data->day_width, | ||
1701 | - day_height); | ||
1702 | + HILDON_DAY_WIDTH, | ||
1703 | + HILDON_DAY_HEIGHT); | ||
1704 | } | ||
1705 | |||
1706 | + /* Hildon: paint green indicator for current day */ | ||
1707 | + if (hildonlike && (day == private_data->current_day && calendar->selected_day != | ||
1708 | + private_data->current_day) && (calendar->day_month[row][col] == MONTH_CURRENT)) | ||
1709 | + gtk_calendar_check_current_date (calendar, x_left, y_top); | ||
1710 | + | ||
1711 | + g_snprintf (buffer, sizeof (buffer), "%d", day); | ||
1712 | + layout = gtk_widget_create_pango_layout (widget, buffer); | ||
1713 | + pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
1714 | + | ||
1715 | + x_loc = x_left + (HILDON_DAY_WIDTH - logical_rect.width) / 2; | ||
1716 | + y_loc = y_top + (HILDON_DAY_HEIGHT - logical_rect.height) / 2; | ||
1717 | + | ||
1718 | + gdk_draw_layout (private_data->main_win, gc, | ||
1719 | + x_loc, y_loc, layout); | ||
1720 | + if (calendar->marked_date[day-1] | ||
1721 | + && calendar->day_month[row][col] == MONTH_CURRENT) | ||
1722 | + gdk_draw_layout (private_data->main_win, gc, | ||
1723 | + x_loc-1, y_loc, layout); | ||
1724 | + | ||
1725 | g_object_unref (layout); | ||
1726 | } | ||
1727 | |||
1728 | @@ -2195,7 +2538,7 @@ | ||
1729 | |||
1730 | g_return_if_fail (GTK_IS_CALENDAR (widget)); | ||
1731 | g_return_if_fail (widget->window != NULL); | ||
1732 | - | ||
1733 | + | ||
1734 | calendar = GTK_CALENDAR (widget); | ||
1735 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1736 | |||
1737 | @@ -2208,7 +2551,7 @@ | ||
1738 | gdk_window_clear (private_data->main_win); | ||
1739 | |||
1740 | /* gtk_calendar_compute_days (calendar); */ /* REMOVE later */ | ||
1741 | - | ||
1742 | + | ||
1743 | for (col = 0; col < 7; col++) | ||
1744 | for (row = 0; row < 6; row++) | ||
1745 | gtk_calendar_paint_day (widget, row, col); | ||
1746 | @@ -2453,9 +2796,24 @@ | ||
1747 | guint month, | ||
1748 | guint year) | ||
1749 | { | ||
1750 | + gboolean hildonlike; | ||
1751 | + guint min_year, max_year; | ||
1752 | + | ||
1753 | g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE); | ||
1754 | g_return_val_if_fail (month <= 11, FALSE); | ||
1755 | |||
1756 | + gtk_widget_style_get(GTK_WIDGET (calendar), "hildonlike", &hildonlike, | ||
1757 | + "max-year", &max_year, "min-year", | ||
1758 | + &min_year, NULL); | ||
1759 | + | ||
1760 | + if (hildonlike) | ||
1761 | + { | ||
1762 | + if (year >= max_year) | ||
1763 | + year = max_year; | ||
1764 | + else if (year <= min_year) | ||
1765 | + year = min_year; | ||
1766 | + } | ||
1767 | + | ||
1768 | calendar->month = month; | ||
1769 | calendar->year = year; | ||
1770 | |||
1771 | @@ -2478,12 +2836,30 @@ | ||
1772 | gtk_calendar_select_day (GtkCalendar *calendar, | ||
1773 | guint day) | ||
1774 | { | ||
1775 | - g_return_if_fail (GTK_IS_CALENDAR (calendar)); | ||
1776 | - g_return_if_fail (day <= 31); | ||
1777 | - | ||
1778 | - /* gtk_calendar_compute_days (calendar); */ | ||
1779 | - | ||
1780 | - /* Deselect the old day */ | ||
1781 | + gint row, col; | ||
1782 | + GtkCalendarPrivateData *priv; | ||
1783 | + g_return_if_fail (GTK_IS_CALENDAR (calendar)); | ||
1784 | + g_return_if_fail (day <= 31); | ||
1785 | + priv = GTK_CALENDAR_PRIVATE_DATA (calendar); | ||
1786 | + | ||
1787 | + for (row = 0; row < 6; row ++) | ||
1788 | + for (col = 0; col < 7; col++) | ||
1789 | + { | ||
1790 | + if (calendar->day_month[row][col] == MONTH_CURRENT | ||
1791 | + && calendar->day[row][col] == day) | ||
1792 | + { | ||
1793 | + calendar->focus_row = row; | ||
1794 | + calendar->focus_col = col; | ||
1795 | + } | ||
1796 | + } | ||
1797 | + | ||
1798 | + /* gtk_calendar_compute_days (calendar); */ | ||
1799 | + | ||
1800 | + if (calendar->month != priv->current_month || | ||
1801 | + calendar->year != priv->current_year) | ||
1802 | + gtk_calendar_unmark_day (calendar, priv->current_day); | ||
1803 | + | ||
1804 | + /* Deselect the old day */ | ||
1805 | if (calendar->selected_day > 0) | ||
1806 | { | ||
1807 | gint selected_day; | ||
1808 | @@ -2491,20 +2867,25 @@ | ||
1809 | selected_day = calendar->selected_day; | ||
1810 | calendar->selected_day = 0; | ||
1811 | if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar))) | ||
1812 | - gtk_calendar_paint_day_num (GTK_WIDGET (calendar), selected_day); | ||
1813 | + { | ||
1814 | + gtk_calendar_paint_day_num (GTK_WIDGET (calendar), selected_day); | ||
1815 | + } | ||
1816 | } | ||
1817 | |||
1818 | calendar->selected_day = day; | ||
1819 | |||
1820 | + /*printf("Selected day = %d\n", day);*/ | ||
1821 | + | ||
1822 | /* Select the new day */ | ||
1823 | if (day != 0) | ||
1824 | { | ||
1825 | if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar))) | ||
1826 | - gtk_calendar_paint_day_num (GTK_WIDGET (calendar), day); | ||
1827 | + { | ||
1828 | + gtk_calendar_paint_day_num (GTK_WIDGET (calendar), day); | ||
1829 | + } | ||
1830 | } | ||
1831 | - | ||
1832 | + | ||
1833 | g_object_notify (G_OBJECT (calendar), "day"); | ||
1834 | - | ||
1835 | g_signal_emit (calendar, | ||
1836 | gtk_calendar_signals[DAY_SELECTED_SIGNAL], | ||
1837 | 0); | ||
1838 | @@ -2560,17 +2941,16 @@ | ||
1839 | gtk_calendar_mark_day (GtkCalendar *calendar, | ||
1840 | guint day) | ||
1841 | { | ||
1842 | - g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE); | ||
1843 | - | ||
1844 | - if (day >= 1 && day <= 31 && calendar->marked_date[day-1] == FALSE) | ||
1845 | - { | ||
1846 | - calendar->marked_date[day - 1] = TRUE; | ||
1847 | - calendar->num_marked_dates++; | ||
1848 | - } | ||
1849 | - if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar))) | ||
1850 | - { | ||
1851 | - gtk_calendar_paint_main (GTK_WIDGET (calendar)); | ||
1852 | - } | ||
1853 | + g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE); | ||
1854 | + if (day >= 1 && day <= 31 && calendar->marked_date[day-1] == FALSE) | ||
1855 | + { | ||
1856 | + calendar->marked_date[day - 1] = TRUE; | ||
1857 | + calendar->num_marked_dates++; | ||
1858 | + } | ||
1859 | + if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar))) | ||
1860 | + { | ||
1861 | + gtk_calendar_paint_main (GTK_WIDGET (calendar)); | ||
1862 | + } | ||
1863 | |||
1864 | return TRUE; | ||
1865 | } | ||
1866 | @@ -2629,14 +3009,15 @@ | ||
1867 | gtk_calendar_set_year_next (calendar); | ||
1868 | break; | ||
1869 | case ARROW_MONTH_LEFT: | ||
1870 | - gtk_calendar_set_month_prev (calendar); | ||
1871 | - break; | ||
1872 | + gtk_calendar_set_month_prev (calendar); | ||
1873 | + break; | ||
1874 | case ARROW_MONTH_RIGHT: | ||
1875 | gtk_calendar_set_month_next (calendar); | ||
1876 | break; | ||
1877 | default:; | ||
1878 | /* do nothing */ | ||
1879 | } | ||
1880 | + gtk_calendar_select_and_focus_day(calendar, calendar->selected_day); | ||
1881 | } | ||
1882 | |||
1883 | static gboolean | ||
1884 | @@ -2645,6 +3026,11 @@ | ||
1885 | GtkCalendar *calendar = data; | ||
1886 | GtkCalendarPrivateData *private_data = GTK_CALENDAR_PRIVATE_DATA (calendar); | ||
1887 | gboolean retval = FALSE; | ||
1888 | + GtkSettings *settings; | ||
1889 | + guint timeout; | ||
1890 | + | ||
1891 | + settings = gtk_settings_get_default (); | ||
1892 | + g_object_get (settings, "gtk-update-timeout", &timeout, NULL); | ||
1893 | |||
1894 | GDK_THREADS_ENTER (); | ||
1895 | |||
1896 | @@ -2655,7 +3041,7 @@ | ||
1897 | if (private_data->need_timer) | ||
1898 | { | ||
1899 | private_data->need_timer = FALSE; | ||
1900 | - private_data->timer = g_timeout_add (CALENDAR_TIMER_DELAY, | ||
1901 | + private_data->timer = g_timeout_add (/*CALENDAR_TIMER_DELAY*/timeout, | ||
1902 | (GSourceFunc) calendar_timer, | ||
1903 | (gpointer) calendar); | ||
1904 | } | ||
1905 | @@ -2673,13 +3059,18 @@ | ||
1906 | gint click_child) | ||
1907 | { | ||
1908 | GtkCalendarPrivateData *private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1909 | + GtkSettings *settings; | ||
1910 | + guint timeout; | ||
1911 | |||
1912 | + settings = gtk_settings_get_default (); | ||
1913 | + g_object_get (settings, "gtk-initial-timeout", &timeout, NULL); | ||
1914 | + | ||
1915 | private_data->click_child = click_child; | ||
1916 | |||
1917 | if (!private_data->timer) | ||
1918 | { | ||
1919 | private_data->need_timer = TRUE; | ||
1920 | - private_data->timer = g_timeout_add (CALENDAR_INITIAL_TIMER_DELAY, | ||
1921 | + private_data->timer = g_timeout_add (/*CALENDAR_INITIAL_TIMER_DELAY*/timeout, | ||
1922 | calendar_timer, | ||
1923 | (gpointer) widget); | ||
1924 | } | ||
1925 | @@ -2738,12 +3129,38 @@ | ||
1926 | GtkCalendar *calendar; | ||
1927 | GtkCalendarPrivateData *private_data; | ||
1928 | gint arrow = -1; | ||
1929 | - | ||
1930 | + gboolean hildonlike; | ||
1931 | + gint min_year, max_year; | ||
1932 | + | ||
1933 | calendar = GTK_CALENDAR (widget); | ||
1934 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1935 | + | ||
1936 | + gtk_widget_style_get(widget, "hildonlike", &hildonlike, | ||
1937 | + "min-year", &min_year, "max-year", &max_year, NULL); | ||
1938 | |||
1939 | - if (event->window == private_data->main_win) | ||
1940 | - gtk_calendar_main_button (widget, event); | ||
1941 | + if (!hildonlike) | ||
1942 | + { | ||
1943 | + if (event->window == private_data->main_win) | ||
1944 | + gtk_calendar_main_button (widget, event); | ||
1945 | + } | ||
1946 | + else if (hildonlike && (event->window == private_data->main_win)) | ||
1947 | + { | ||
1948 | + gint x = (gint) (event->x); | ||
1949 | + gint y = (gint) (event->y); | ||
1950 | + gint row = row_from_y (calendar, y); | ||
1951 | + gint col = column_from_x (calendar, x); | ||
1952 | + private_data->pressed_day = calendar->day[row][col]; | ||
1953 | + | ||
1954 | + if ((calendar->year == min_year && calendar->month == 0 && calendar->day_month[row][col] == MONTH_PREV) || | ||
1955 | + (calendar->year == max_year && calendar->month == 11 && calendar->day_month[row][col] == MONTH_NEXT)) | ||
1956 | + {} | ||
1957 | + else if (calendar->day_month[row][col] == MONTH_CURRENT) | ||
1958 | + gtk_calendar_select_and_focus_day (calendar, private_data->pressed_day); | ||
1959 | + | ||
1960 | + /* Remember month where button was pressed */ | ||
1961 | + private_data->pressed_month = calendar->month; | ||
1962 | + private_data->slide_stylus = TRUE; | ||
1963 | + } | ||
1964 | |||
1965 | if (!GTK_WIDGET_HAS_FOCUS (widget)) | ||
1966 | gtk_widget_grab_focus (widget); | ||
1967 | @@ -2766,7 +3183,7 @@ | ||
1968 | } | ||
1969 | } | ||
1970 | |||
1971 | - return FALSE; | ||
1972 | + return TRUE; | ||
1973 | } | ||
1974 | |||
1975 | static gboolean | ||
1976 | @@ -2775,16 +3192,45 @@ | ||
1977 | { | ||
1978 | GtkCalendar *calendar; | ||
1979 | GtkCalendarPrivateData *private_data; | ||
1980 | + gboolean hildonlike; | ||
1981 | |||
1982 | calendar = GTK_CALENDAR (widget); | ||
1983 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
1984 | |||
1985 | + gtk_widget_style_get(widget, "hildonlike", &hildonlike, | ||
1986 | + NULL); | ||
1987 | + | ||
1988 | + if (hildonlike && (event->window == private_data->main_win)) | ||
1989 | + { | ||
1990 | + gtk_calendar_main_button (widget, event); | ||
1991 | + gint x = (gint) (event->x); | ||
1992 | + gint y = (gint) (event->y); | ||
1993 | + gint row = row_from_y (calendar, y); | ||
1994 | + gint col = column_from_x (calendar, x); | ||
1995 | + private_data->prev_col = -1; | ||
1996 | + private_data->prev_row = -1; | ||
1997 | + | ||
1998 | + if ((private_data->pressed_day == calendar->day[row][col]) && | ||
1999 | + (private_data->pressed_month == calendar->month)) | ||
2000 | + { | ||
2001 | + if (!private_data->is_bad_day) | ||
2002 | + { | ||
2003 | + g_signal_emit (calendar, gtk_calendar_signals[SELECTED_DATE_SIGNAL], 0); | ||
2004 | + } | ||
2005 | + else | ||
2006 | + { | ||
2007 | + private_data->is_bad_day = FALSE; | ||
2008 | + } | ||
2009 | + } | ||
2010 | + private_data->slide_stylus = FALSE; | ||
2011 | + } | ||
2012 | + | ||
2013 | if (event->button == 1) | ||
2014 | { | ||
2015 | stop_spinning (widget); | ||
2016 | |||
2017 | if (private_data->in_drag) | ||
2018 | - private_data->in_drag = 0; | ||
2019 | + private_data->in_drag = 0; | ||
2020 | } | ||
2021 | |||
2022 | return TRUE; | ||
2023 | @@ -2799,15 +3245,42 @@ | ||
2024 | gint event_x, event_y; | ||
2025 | gint row, col; | ||
2026 | gint old_row, old_col; | ||
2027 | + gboolean hildonlike; | ||
2028 | |||
2029 | calendar = GTK_CALENDAR (widget); | ||
2030 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
2031 | event_x = (gint) (event->x); | ||
2032 | event_y = (gint) (event->y); | ||
2033 | - | ||
2034 | + | ||
2035 | + gtk_widget_style_get(widget, "hildonlike", &hildonlike, | ||
2036 | + NULL); | ||
2037 | + | ||
2038 | if (event->window == private_data->main_win) | ||
2039 | { | ||
2040 | - | ||
2041 | + if (hildonlike) | ||
2042 | + { | ||
2043 | + /* Hildon: make active day to move, when stylus is slided */ | ||
2044 | + if (private_data->slide_stylus) | ||
2045 | + { | ||
2046 | + gint c_row = row_from_y (calendar, event_y); | ||
2047 | + gint c_col = column_from_x (calendar, event_x); | ||
2048 | + | ||
2049 | + if (calendar->day_month[c_row][c_col] == MONTH_PREV || | ||
2050 | + calendar->day_month[c_row][c_col] == MONTH_NEXT) | ||
2051 | + { } | ||
2052 | + else if ((private_data->prev_row != c_row || private_data->prev_col != c_col) && | ||
2053 | + (calendar->highlight_row != -1 && calendar->highlight_col != -1)) | ||
2054 | + { | ||
2055 | + gtk_calendar_select_and_focus_day (calendar, | ||
2056 | + calendar->day[c_row][c_col]); | ||
2057 | + /* Update passive focus indicators work weekday number and name */ | ||
2058 | + gtk_calendar_paint_week_numbers (GTK_WIDGET (calendar)); | ||
2059 | + gtk_calendar_paint_day_names (GTK_WIDGET (calendar)); | ||
2060 | + } | ||
2061 | + private_data->prev_col = c_col; | ||
2062 | + private_data->prev_row = c_row; | ||
2063 | + } | ||
2064 | + } | ||
2065 | if (private_data->in_drag) | ||
2066 | { | ||
2067 | if (gtk_drag_check_threshold (widget, | ||
2068 | @@ -2847,7 +3320,7 @@ | ||
2069 | calendar->highlight_col = col; | ||
2070 | |||
2071 | if (row > -1 && col > -1) | ||
2072 | - gtk_calendar_paint_day (widget, row, col); | ||
2073 | + gtk_calendar_paint_day (widget, row, col); | ||
2074 | } | ||
2075 | } | ||
2076 | } | ||
2077 | @@ -2863,7 +3336,7 @@ | ||
2078 | |||
2079 | calendar = GTK_CALENDAR (widget); | ||
2080 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
2081 | - | ||
2082 | + | ||
2083 | if (event->window == private_data->arrow_win[ARROW_MONTH_LEFT]) | ||
2084 | { | ||
2085 | private_data->arrow_state[ARROW_MONTH_LEFT] = GTK_STATE_PRELIGHT; | ||
2086 | @@ -2902,7 +3375,7 @@ | ||
2087 | |||
2088 | calendar = GTK_CALENDAR (widget); | ||
2089 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
2090 | - | ||
2091 | + | ||
2092 | if (event->window == private_data->main_win) | ||
2093 | { | ||
2094 | row = calendar->highlight_row; | ||
2095 | @@ -2910,7 +3383,7 @@ | ||
2096 | calendar->highlight_row = -1; | ||
2097 | calendar->highlight_col = -1; | ||
2098 | if (row > -1 && col > -1) | ||
2099 | - gtk_calendar_paint_day (widget, row, col); | ||
2100 | + gtk_calendar_paint_day (widget, row, col); | ||
2101 | } | ||
2102 | |||
2103 | if (event->window == private_data->arrow_win[ARROW_MONTH_LEFT]) | ||
2104 | @@ -2949,10 +3422,14 @@ | ||
2105 | GdkGC *gc; | ||
2106 | GtkCalendar *calendar; | ||
2107 | gint state; | ||
2108 | - gint width, height; | ||
2109 | + gint max_year, min_year; | ||
2110 | + gboolean hildonlike; | ||
2111 | +/* gint width, height;*/ | ||
2112 | |||
2113 | calendar = GTK_CALENDAR (widget); | ||
2114 | private_data = GTK_CALENDAR_PRIVATE_DATA (widget); | ||
2115 | + gtk_widget_style_get (widget, "hildonlike", &hildonlike, "max-year", | ||
2116 | + &max_year, "min-year", &min_year, NULL); | ||
2117 | |||
2118 | if (private_data->freeze_count) | ||
2119 | { | ||
2120 | @@ -2965,23 +3442,81 @@ | ||
2121 | state = private_data->arrow_state[arrow]; | ||
2122 | gc = calendar->gc; | ||
2123 | |||
2124 | - gdk_window_clear (window); | ||
2125 | +/* gdk_window_clear (window);*/ | ||
2126 | gdk_window_set_background (window, &(widget)->style->bg[state]); | ||
2127 | - gdk_drawable_get_size (window, &width, &height); | ||
2128 | - gdk_window_clear_area (window, | ||
2129 | +/* gdk_drawable_get_size (window, &width, &height);*/ | ||
2130 | +/* gdk_window_clear_area (window, | ||
2131 | 0,0, | ||
2132 | - width,height); | ||
2133 | - if (arrow == ARROW_MONTH_LEFT || arrow == ARROW_YEAR_LEFT) | ||
2134 | - gtk_paint_arrow (widget->style, window, state, | ||
2135 | + width,height);*/ | ||
2136 | + | ||
2137 | + gdk_window_clear(window); | ||
2138 | + | ||
2139 | + /* Hildon: added support for dimmed arrows */ | ||
2140 | + if (hildonlike && (calendar->year <= min_year || calendar->year >= max_year)) | ||
2141 | + { | ||
2142 | + if (calendar->year <= min_year) | ||
2143 | + { | ||
2144 | + if (arrow == ARROW_YEAR_LEFT) | ||
2145 | + gtk_paint_arrow (widget->style, window, GTK_STATE_INSENSITIVE, | ||
2146 | + GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2147 | + GTK_ARROW_LEFT, TRUE, | ||
2148 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2149 | + else if (arrow == ARROW_YEAR_RIGHT || arrow == ARROW_MONTH_RIGHT) | ||
2150 | + gtk_paint_arrow (widget->style, window, state, | ||
2151 | + GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2152 | + GTK_ARROW_RIGHT, TRUE, | ||
2153 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2154 | + else if (arrow == ARROW_MONTH_LEFT && calendar->month != 0) | ||
2155 | + gtk_paint_arrow (widget->style, window, state, | ||
2156 | + GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2157 | + GTK_ARROW_LEFT, TRUE, | ||
2158 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2159 | + else if (arrow == ARROW_MONTH_LEFT && !calendar->month) | ||
2160 | + gtk_paint_arrow (widget->style, window, GTK_STATE_INSENSITIVE, | ||
2161 | + GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2162 | + GTK_ARROW_LEFT, TRUE, | ||
2163 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2164 | + } | ||
2165 | + else if (calendar->year >= max_year) | ||
2166 | + { | ||
2167 | + if (arrow == ARROW_YEAR_RIGHT) | ||
2168 | + gtk_paint_arrow (widget->style, window, GTK_STATE_INSENSITIVE, | ||
2169 | + GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2170 | + GTK_ARROW_RIGHT, TRUE, | ||
2171 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2172 | + else if (arrow == ARROW_YEAR_LEFT || arrow == ARROW_MONTH_LEFT) | ||
2173 | + gtk_paint_arrow (widget->style, window, state, | ||
2174 | GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2175 | GTK_ARROW_LEFT, TRUE, | ||
2176 | - width/2 - 3, height/2 - 4, 8, 8); | ||
2177 | - else | ||
2178 | - gtk_paint_arrow (widget->style, window, state, | ||
2179 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2180 | + else if (arrow == ARROW_MONTH_RIGHT && calendar->month != 11) | ||
2181 | + gtk_paint_arrow (widget->style, window, state, | ||
2182 | + GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2183 | + GTK_ARROW_RIGHT, TRUE, | ||
2184 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2185 | + else if (arrow == ARROW_MONTH_RIGHT && calendar->month == 11) | ||
2186 | + gtk_paint_arrow (widget->style, window, GTK_STATE_INSENSITIVE, | ||
2187 | + GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2188 | + GTK_ARROW_RIGHT, TRUE, | ||
2189 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2190 | + } | ||
2191 | + } | ||
2192 | + else | ||
2193 | + { | ||
2194 | + if (arrow == ARROW_MONTH_LEFT || arrow == ARROW_YEAR_LEFT) | ||
2195 | + gtk_paint_arrow (widget->style, window, state, | ||
2196 | + GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2197 | + GTK_ARROW_LEFT, TRUE, | ||
2198 | + /* width/2 - 3, height/2 - 4, 8, 8);*/ | ||
2199 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2200 | + else | ||
2201 | + gtk_paint_arrow (widget->style, window, state, | ||
2202 | GTK_SHADOW_OUT, NULL, widget, "calendar", | ||
2203 | GTK_ARROW_RIGHT, TRUE, | ||
2204 | - width/2 - 2, height/2 - 4, 8, 8); | ||
2205 | - } | ||
2206 | + /* width/2 - 2, height/2 - 4, 8, 8);*/ | ||
2207 | + 0, 0, HILDON_ARROW_WIDTH, HILDON_ARROW_HEIGHT); | ||
2208 | + } | ||
2209 | + } | ||
2210 | } | ||
2211 | |||
2212 | void | ||
2213 | @@ -3159,17 +3694,26 @@ | ||
2214 | GdkEventKey *event) | ||
2215 | { | ||
2216 | GtkCalendar *calendar; | ||
2217 | + GtkSettings *settings; | ||
2218 | gint return_val; | ||
2219 | gint old_focus_row; | ||
2220 | gint old_focus_col; | ||
2221 | gint row, col, day; | ||
2222 | - | ||
2223 | + gint min_year, max_year; | ||
2224 | + gboolean knav; | ||
2225 | + | ||
2226 | calendar = GTK_CALENDAR (widget); | ||
2227 | return_val = FALSE; | ||
2228 | |||
2229 | old_focus_row = calendar->focus_row; | ||
2230 | old_focus_col = calendar->focus_col; | ||
2231 | |||
2232 | + gtk_widget_style_get (widget, "max-year", &max_year, | ||
2233 | + "min-year", &min_year, NULL); | ||
2234 | + | ||
2235 | + settings = gtk_settings_get_default (); | ||
2236 | + g_object_get (settings, "hildon-keyboard-navigation", &knav, NULL); | ||
2237 | + | ||
2238 | switch (event->keyval) | ||
2239 | { | ||
2240 | case GDK_KP_Left: | ||
2241 | @@ -3179,10 +3723,41 @@ | ||
2242 | gtk_calendar_set_month_prev (calendar); | ||
2243 | else | ||
2244 | { | ||
2245 | - move_focus (calendar, -1); | ||
2246 | - gtk_calendar_paint_day (widget, old_focus_row, old_focus_col); | ||
2247 | - gtk_calendar_paint_day (widget, calendar->focus_row, | ||
2248 | - calendar->focus_col); | ||
2249 | + /* if we are at the first allowed day of the minimum year/month then do nothing */ | ||
2250 | + if (calendar->year == min_year && calendar->month == 0 && calendar->day_month[old_focus_row][old_focus_col-1] == MONTH_PREV) | ||
2251 | + { | ||
2252 | + g_signal_emit (calendar, gtk_calendar_signals[ERRONEOUS_DATE_SIGNAL], 0); | ||
2253 | + return TRUE; | ||
2254 | + } | ||
2255 | + else /* else normal */ | ||
2256 | + { | ||
2257 | + move_focus (calendar, -1); | ||
2258 | + if (!knav) | ||
2259 | + { | ||
2260 | + gtk_calendar_paint_day (widget, old_focus_row, old_focus_col); | ||
2261 | + gtk_calendar_paint_day (widget, calendar->focus_row, | ||
2262 | + calendar->focus_col); | ||
2263 | + } | ||
2264 | + else if (knav) | ||
2265 | + { | ||
2266 | + gint day_month = calendar->day_month[calendar->focus_row][calendar->focus_col]; | ||
2267 | + if (day_month == MONTH_CURRENT && calendar->selected_day != 1) | ||
2268 | + { | ||
2269 | + gtk_calendar_select_day(calendar, calendar->selected_day - 1); | ||
2270 | + } | ||
2271 | + else | ||
2272 | + { | ||
2273 | + if (calendar->month != 0) { | ||
2274 | + calendar->selected_day = month_length[leap (calendar->year)][calendar->month]; | ||
2275 | + } else { | ||
2276 | + calendar->selected_day = month_length[leap (calendar->year -1)][12]; | ||
2277 | + } | ||
2278 | + gtk_calendar_set_month_prev (calendar); | ||
2279 | + } | ||
2280 | + gtk_calendar_paint_week_numbers (GTK_WIDGET (calendar)); | ||
2281 | + gtk_calendar_paint_day_names (GTK_WIDGET (calendar)); | ||
2282 | + } | ||
2283 | + } | ||
2284 | } | ||
2285 | break; | ||
2286 | case GDK_KP_Right: | ||
2287 | @@ -3192,10 +3767,36 @@ | ||
2288 | gtk_calendar_set_month_next (calendar); | ||
2289 | else | ||
2290 | { | ||
2291 | - move_focus (calendar, 1); | ||
2292 | - gtk_calendar_paint_day (widget, old_focus_row, old_focus_col); | ||
2293 | - gtk_calendar_paint_day (widget, calendar->focus_row, | ||
2294 | - calendar->focus_col); | ||
2295 | + if (calendar->year == max_year && calendar->month == 11 && calendar->day_month[old_focus_row][old_focus_col+1] == MONTH_NEXT) | ||
2296 | + { | ||
2297 | + g_signal_emit (calendar, gtk_calendar_signals[ERRONEOUS_DATE_SIGNAL], 0); | ||
2298 | + return TRUE; | ||
2299 | + } | ||
2300 | + else | ||
2301 | + { | ||
2302 | + move_focus (calendar, 1); | ||
2303 | + if (!knav) | ||
2304 | + { | ||
2305 | + gtk_calendar_paint_day (widget, old_focus_row, old_focus_col); | ||
2306 | + gtk_calendar_paint_day (widget, calendar->focus_row, | ||
2307 | + calendar->focus_col); | ||
2308 | + } | ||
2309 | + else if (knav) | ||
2310 | + { | ||
2311 | + gint day_month = calendar->day_month[calendar->focus_row][calendar->focus_col]; | ||
2312 | + if (day_month == MONTH_CURRENT) | ||
2313 | + { | ||
2314 | + gtk_calendar_select_day (calendar, calendar->selected_day + 1); | ||
2315 | + } | ||
2316 | + else | ||
2317 | + { | ||
2318 | + calendar->selected_day = 1; | ||
2319 | + gtk_calendar_set_month_next (calendar); | ||
2320 | + } | ||
2321 | + gtk_calendar_paint_week_numbers (GTK_WIDGET (calendar)); | ||
2322 | + gtk_calendar_paint_day_names (GTK_WIDGET (calendar)); | ||
2323 | + } | ||
2324 | + } | ||
2325 | } | ||
2326 | break; | ||
2327 | case GDK_KP_Up: | ||
2328 | @@ -3205,11 +3806,48 @@ | ||
2329 | gtk_calendar_set_year_prev (calendar); | ||
2330 | else | ||
2331 | { | ||
2332 | - if (calendar->focus_row > 0) | ||
2333 | - calendar->focus_row--; | ||
2334 | - gtk_calendar_paint_day (widget, old_focus_row, old_focus_col); | ||
2335 | - gtk_calendar_paint_day (widget, calendar->focus_row, | ||
2336 | - calendar->focus_col); | ||
2337 | + if (calendar->year == min_year && calendar->month == 0 && calendar->day_month[old_focus_row-1][old_focus_col] == MONTH_PREV) | ||
2338 | + { | ||
2339 | + g_signal_emit (calendar, gtk_calendar_signals[ERRONEOUS_DATE_SIGNAL], 0); | ||
2340 | + return TRUE; | ||
2341 | + } | ||
2342 | + else | ||
2343 | + { | ||
2344 | + if (calendar->focus_row > 0) | ||
2345 | + calendar->focus_row--; | ||
2346 | + if (!knav) | ||
2347 | + { | ||
2348 | + gtk_calendar_paint_day (widget, old_focus_row, old_focus_col); | ||
2349 | + gtk_calendar_paint_day (widget, calendar->focus_row, | ||
2350 | + calendar->focus_col); | ||
2351 | + } | ||
2352 | + else if (knav) | ||
2353 | + { | ||
2354 | + gint day_month = calendar->day_month[calendar->focus_row][calendar->focus_col]; | ||
2355 | + if (day_month == MONTH_CURRENT) | ||
2356 | + { | ||
2357 | + if ((calendar->selected_day - 7) <= 0) | ||
2358 | + { | ||
2359 | + if (calendar->month != 0) | ||
2360 | + calendar->selected_day = month_length[leap (calendar->year)][calendar->month]; | ||
2361 | + else | ||
2362 | + calendar->selected_day = month_length[leap (calendar->year - 1)][12]; | ||
2363 | + gtk_calendar_set_month_prev (calendar); | ||
2364 | + } | ||
2365 | + else | ||
2366 | + { | ||
2367 | + gtk_calendar_select_day (calendar, calendar->selected_day - 7); | ||
2368 | + } | ||
2369 | + } | ||
2370 | + else | ||
2371 | + { | ||
2372 | + calendar->selected_day = calendar->day[calendar->focus_row][calendar->focus_col]; | ||
2373 | + gtk_calendar_set_month_prev (calendar); | ||
2374 | + } | ||
2375 | + gtk_calendar_paint_week_numbers (GTK_WIDGET (calendar)); | ||
2376 | + gtk_calendar_paint_day_names (GTK_WIDGET (calendar)); | ||
2377 | + } | ||
2378 | + } | ||
2379 | } | ||
2380 | break; | ||
2381 | case GDK_KP_Down: | ||
2382 | @@ -3219,12 +3857,49 @@ | ||
2383 | gtk_calendar_set_year_next (calendar); | ||
2384 | else | ||
2385 | { | ||
2386 | - if (calendar->focus_row < 5) | ||
2387 | - calendar->focus_row++; | ||
2388 | - gtk_calendar_paint_day (widget, old_focus_row, old_focus_col); | ||
2389 | - gtk_calendar_paint_day (widget, calendar->focus_row, | ||
2390 | - calendar->focus_col); | ||
2391 | + if (calendar->year == max_year && calendar->month == 11 && calendar->day_month[old_focus_row+1][old_focus_col] == MONTH_NEXT) | ||
2392 | + { | ||
2393 | + g_signal_emit (calendar, gtk_calendar_signals[ERRONEOUS_DATE_SIGNAL], 0); | ||
2394 | + return TRUE; | ||
2395 | + } | ||
2396 | + else | ||
2397 | + { | ||
2398 | + | ||
2399 | + if (calendar->focus_row < 5) | ||
2400 | + calendar->focus_row++; | ||
2401 | + if (!knav) | ||
2402 | + { | ||
2403 | + gtk_calendar_paint_day (widget, old_focus_row, old_focus_col); | ||
2404 | + gtk_calendar_paint_day (widget, calendar->focus_row, | ||
2405 | + calendar->focus_col); | ||
2406 | + } | ||
2407 | + else if (knav) | ||
2408 | + { | ||
2409 | + gint day_month = calendar->day_month[calendar->focus_row][calendar->focus_col]; | ||
2410 | + if (day_month == MONTH_CURRENT) | ||
2411 | + { | ||
2412 | + if ((calendar->selected_day + 7) > | ||
2413 | + month_length[leap (calendar->year)][calendar->month + 1]) | ||
2414 | + { | ||
2415 | + calendar->selected_day = 1; | ||
2416 | + gtk_calendar_set_month_next (calendar); | ||
2417 | + } | ||
2418 | + else | ||
2419 | + { | ||
2420 | + gtk_calendar_select_day (calendar, calendar->selected_day + 7); | ||
2421 | + } | ||
2422 | + } | ||
2423 | + else | ||
2424 | + { | ||
2425 | + calendar->selected_day = calendar->day[calendar->focus_row][calendar->focus_col]; | ||
2426 | + gtk_calendar_set_month_next (calendar); | ||
2427 | + } | ||
2428 | + gtk_calendar_paint_week_numbers (GTK_WIDGET (calendar)); | ||
2429 | + gtk_calendar_paint_day_names (GTK_WIDGET (calendar)); | ||
2430 | + } | ||
2431 | + } | ||
2432 | } | ||
2433 | + | ||
2434 | break; | ||
2435 | case GDK_KP_Space: | ||
2436 | case GDK_space: | ||
2437 | @@ -3545,3 +4220,27 @@ | ||
2438 | gtk_calendar_select_day (calendar, day); | ||
2439 | g_object_thaw_notify (G_OBJECT (calendar)); | ||
2440 | } | ||
2441 | + | ||
2442 | +/* This function return TRUE if we should mark date and FALSE | ||
2443 | + * otherwise | ||
2444 | + */ | ||
2445 | +static void | ||
2446 | +gtk_calendar_check_current_date (GtkCalendar *calendar, gint x, gint y) | ||
2447 | +{ | ||
2448 | + GtkCalendarPrivateData *private_data; | ||
2449 | + | ||
2450 | + private_data = GTK_CALENDAR_PRIVATE_DATA (calendar); | ||
2451 | + | ||
2452 | + if (calendar->month == private_data->current_month && | ||
2453 | + calendar->year == private_data->current_year) | ||
2454 | + { | ||
2455 | + gtk_paint_box( GTK_WIDGET (calendar)->style, | ||
2456 | + private_data->main_win, | ||
2457 | + GTK_STATE_NORMAL, | ||
2458 | + GTK_SHADOW_NONE, NULL, | ||
2459 | + GTK_WIDGET (calendar), "current-day", | ||
2460 | + x, y, | ||
2461 | + HILDON_DAY_WIDTH, | ||
2462 | + HILDON_DAY_HEIGHT); | ||
2463 | + } | ||
2464 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcalendar.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcalendar.h.diff deleted file mode 100644 index 185d27e8a2..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcalendar.h.diff +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcalendar.h 2003-05-08 03:25:48.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcalendar.h 2005-04-06 16:19:36.267024936 +0300 | ||
3 | @@ -111,6 +111,9 @@ | ||
4 | void (* next_month) (GtkCalendar *calendar); | ||
5 | void (* prev_year) (GtkCalendar *calendar); | ||
6 | void (* next_year) (GtkCalendar *calendar); | ||
7 | + /* Hildon signals */ | ||
8 | + void (* erroneous_date) (GtkCalendar *calendar); | ||
9 | + void (* selected_date) (GtkCalendar *calendar); | ||
10 | |||
11 | }; | ||
12 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellrenderertext.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellrenderertext.c.diff deleted file mode 100644 index b24c26120a..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellrenderertext.c.diff +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcellrenderertext.c 2005-01-09 19:32:25.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcellrenderertext.c 2005-04-06 16:19:36.274023872 +0300 | ||
3 | @@ -182,8 +182,8 @@ | ||
4 | |||
5 | GTK_CELL_RENDERER (celltext)->xalign = 0.0; | ||
6 | GTK_CELL_RENDERER (celltext)->yalign = 0.5; | ||
7 | - GTK_CELL_RENDERER (celltext)->xpad = 2; | ||
8 | - GTK_CELL_RENDERER (celltext)->ypad = 2; | ||
9 | + GTK_CELL_RENDERER (celltext)->xpad = 0; | ||
10 | + GTK_CELL_RENDERER (celltext)->ypad = 0; | ||
11 | celltext->fixed_height_rows = -1; | ||
12 | celltext->font = pango_font_description_new (); | ||
13 | |||
14 | @@ -1429,7 +1429,7 @@ | ||
15 | /* The minimum size for ellipsized labels is ~ 3 chars */ | ||
16 | if (width) | ||
17 | { | ||
18 | - if (priv->ellipsize || priv->width_chars > 0) | ||
19 | + /*if (priv->ellipsize || priv->width_chars > 0) | ||
20 | { | ||
21 | PangoContext *context; | ||
22 | PangoFontMetrics *metrics; | ||
23 | @@ -1444,9 +1444,9 @@ | ||
24 | *width += (PANGO_PIXELS (char_width) * MAX (priv->width_chars, 3)); | ||
25 | } | ||
26 | else | ||
27 | - { | ||
28 | + {*/ | ||
29 | *width = GTK_CELL_RENDERER (celltext)->xpad * 2 + rect.width; | ||
30 | - } | ||
31 | + /*} */ | ||
32 | } | ||
33 | |||
34 | if (cell_area) | ||
35 | @@ -1501,6 +1501,7 @@ | ||
36 | gint x_offset; | ||
37 | gint y_offset; | ||
38 | GtkCellRendererTextPrivate *priv; | ||
39 | + PangoRectangle logical_rect; | ||
40 | |||
41 | priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell); | ||
42 | |||
43 | @@ -1521,7 +1522,7 @@ | ||
44 | else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT && | ||
45 | GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) | ||
46 | { | ||
47 | - state = GTK_STATE_PRELIGHT; | ||
48 | + state = GTK_STATE_NORMAL; | ||
49 | } | ||
50 | else | ||
51 | { | ||
52 | @@ -1559,6 +1560,14 @@ | ||
53 | g_object_unref (gc); | ||
54 | } | ||
55 | |||
56 | + /* Dirty Hildon hack to force ellipsation */ | ||
57 | + pango_layout_get_extents (layout, NULL, &logical_rect); | ||
58 | + if (PANGO_PIXELS (logical_rect.width) > MIN (background_area->width, expose_area->width)) | ||
59 | + { | ||
60 | + priv->ellipsize = PANGO_ELLIPSIZE_END; | ||
61 | + priv->ellipsize_set = TRUE; | ||
62 | + } | ||
63 | + | ||
64 | if (priv->ellipsize) | ||
65 | pango_layout_set_width (layout, | ||
66 | (cell_area->width - x_offset - 2 * cell->xpad) * PANGO_SCALE); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellrenderertoggle.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellrenderertoggle.c.diff deleted file mode 100644 index f6d47f2174..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellrenderertoggle.c.diff +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcellrenderertoggle.c 2004-08-09 19:59:51.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcellrenderertoggle.c 2005-04-06 16:19:36.274023872 +0300 | ||
3 | @@ -71,7 +71,7 @@ | ||
4 | PROP_INCONSISTENT | ||
5 | }; | ||
6 | |||
7 | -#define TOGGLE_WIDTH 12 | ||
8 | +#define TOGGLE_WIDTH 26 | ||
9 | |||
10 | static guint toggle_cell_signals[LAST_SIGNAL] = { 0 }; | ||
11 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellview.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellview.c.diff deleted file mode 100644 index a6dbfc6a4a..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellview.c.diff +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcellview.c 2004-12-15 18:27:30.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcellview.c 2005-04-06 16:19:36.275023720 +0300 | ||
3 | @@ -82,7 +82,6 @@ | ||
4 | GValue *value); | ||
5 | static GtkCellViewCellInfo *gtk_cell_view_get_cell_info (GtkCellView *cellview, | ||
6 | GtkCellRenderer *renderer); | ||
7 | -static void gtk_cell_view_set_cell_data (GtkCellView *cell_view); | ||
8 | |||
9 | |||
10 | static void gtk_cell_view_cell_layout_pack_start (GtkCellLayout *layout, | ||
11 | @@ -536,7 +535,7 @@ | ||
12 | return NULL; | ||
13 | } | ||
14 | |||
15 | -static void | ||
16 | +void | ||
17 | gtk_cell_view_set_cell_data (GtkCellView *cell_view) | ||
18 | { | ||
19 | GList *i; | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellview.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellview.h.diff deleted file mode 100644 index eb46720a90..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcellview.h.diff +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcellview.h 2004-12-15 18:27:30.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcellview.h 2005-04-06 16:19:36.317017336 +0300 | ||
3 | @@ -67,6 +67,7 @@ | ||
4 | |||
5 | void gtk_cell_view_set_background_color (GtkCellView *cell_view, | ||
6 | const GdkColor *color); | ||
7 | +void gtk_cell_view_set_cell_data (GtkCellView *cellview); | ||
8 | GList *gtk_cell_view_get_cell_renderers (GtkCellView *cell_view); | ||
9 | |||
10 | G_END_DECLS | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcheckbutton.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcheckbutton.c.diff deleted file mode 100644 index c6922ddc16..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcheckbutton.c.diff +++ /dev/null | |||
@@ -1,520 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcheckbutton.c 2004-08-09 19:59:51.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcheckbutton.c 2005-04-06 16:19:36.317017336 +0300 | ||
3 | @@ -31,27 +31,44 @@ | ||
4 | #include "gtklabel.h" | ||
5 | |||
6 | |||
7 | -#define INDICATOR_SIZE 13 | ||
8 | +#define INDICATOR_SIZE 24 | ||
9 | #define INDICATOR_SPACING 2 | ||
10 | |||
11 | +/* maJiK numbers for indicator */ | ||
12 | +#define INDICATOR_SIDE_PADDING 5 | ||
13 | +#define FOCUS_TOP_PADDING 7 | ||
14 | +#define FOCUS_DOWN_PADDING 1 | ||
15 | + | ||
16 | +/* spacing to take account of the 1 pixel | ||
17 | + transparency of the widgetfocus.png | ||
18 | +*/ | ||
19 | +#define HILDON_SPACING 1 | ||
20 | + | ||
21 | +#define TOGGLE_ON_CLICK "toggle-on-click" | ||
22 | |||
23 | -static void gtk_check_button_class_init (GtkCheckButtonClass *klass); | ||
24 | -static void gtk_check_button_init (GtkCheckButton *check_button); | ||
25 | -static void gtk_check_button_size_request (GtkWidget *widget, | ||
26 | - GtkRequisition *requisition); | ||
27 | -static void gtk_check_button_size_allocate (GtkWidget *widget, | ||
28 | - GtkAllocation *allocation); | ||
29 | -static gint gtk_check_button_expose (GtkWidget *widget, | ||
30 | - GdkEventExpose *event); | ||
31 | -static void gtk_check_button_paint (GtkWidget *widget, | ||
32 | - GdkRectangle *area); | ||
33 | -static void gtk_check_button_draw_indicator (GtkCheckButton *check_button, | ||
34 | - GdkRectangle *area); | ||
35 | -static void gtk_real_check_button_draw_indicator (GtkCheckButton *check_button, | ||
36 | - GdkRectangle *area); | ||
37 | +static void gtk_check_button_class_init (GtkCheckButtonClass *klass); | ||
38 | +static void gtk_check_button_init (GtkCheckButton *check_button); | ||
39 | +static void gtk_check_button_size_request (GtkWidget *widget, | ||
40 | + GtkRequisition *requisition); | ||
41 | +static void gtk_check_button_size_allocate (GtkWidget *widget, | ||
42 | + GtkAllocation *allocation); | ||
43 | +static gint gtk_check_button_expose (GtkWidget *widget, | ||
44 | + GdkEventExpose *event); | ||
45 | +static void gtk_check_button_paint (GtkWidget *widget, | ||
46 | + GdkRectangle *area); | ||
47 | +static void gtk_check_button_draw_indicator (GtkCheckButton *check_button, | ||
48 | + GdkRectangle *area); | ||
49 | +static void gtk_real_check_button_draw_indicator | ||
50 | + (GtkCheckButton *check_button, | ||
51 | + GdkRectangle *area); | ||
52 | |||
53 | -static GtkToggleButtonClass *parent_class = NULL; | ||
54 | +static void gtk_check_button_calc_indicator_size( GtkCheckButton *button, | ||
55 | + GdkRectangle *rect ); | ||
56 | + | ||
57 | +static void gtk_check_button_clicked (GtkButton *button); | ||
58 | +static void gtk_check_button_update_state (GtkButton *button); | ||
59 | |||
60 | +static GtkToggleButtonClass *parent_class = NULL; | ||
61 | |||
62 | GType | ||
63 | gtk_check_button_get_type (void) | ||
64 | @@ -85,32 +102,36 @@ | ||
65 | gtk_check_button_class_init (GtkCheckButtonClass *class) | ||
66 | { | ||
67 | GtkWidgetClass *widget_class; | ||
68 | - | ||
69 | + GtkButtonClass *button_class; | ||
70 | + | ||
71 | widget_class = (GtkWidgetClass*) class; | ||
72 | + button_class = (GtkButtonClass*) class; | ||
73 | parent_class = g_type_class_peek_parent (class); | ||
74 | |||
75 | widget_class->size_request = gtk_check_button_size_request; | ||
76 | widget_class->size_allocate = gtk_check_button_size_allocate; | ||
77 | widget_class->expose_event = gtk_check_button_expose; | ||
78 | |||
79 | + button_class->clicked = gtk_check_button_clicked; | ||
80 | + | ||
81 | class->draw_indicator = gtk_real_check_button_draw_indicator; | ||
82 | |||
83 | gtk_widget_class_install_style_property (widget_class, | ||
84 | g_param_spec_int ("indicator_size", | ||
85 | - P_("Indicator Size"), | ||
86 | - P_("Size of check or radio indicator"), | ||
87 | - 0, | ||
88 | - G_MAXINT, | ||
89 | - INDICATOR_SIZE, | ||
90 | - G_PARAM_READABLE)); | ||
91 | + P_("Indicator Size"), | ||
92 | + P_("Size of check or radio indicator"), | ||
93 | + 0, | ||
94 | + G_MAXINT, | ||
95 | + INDICATOR_SIZE, | ||
96 | + G_PARAM_READABLE)); | ||
97 | gtk_widget_class_install_style_property (widget_class, | ||
98 | g_param_spec_int ("indicator_spacing", | ||
99 | - P_("Indicator Spacing"), | ||
100 | - P_("Spacing around check or radio indicator"), | ||
101 | - 0, | ||
102 | - G_MAXINT, | ||
103 | - INDICATOR_SPACING, | ||
104 | - G_PARAM_READABLE)); | ||
105 | + P_("Indicator Spacing"), | ||
106 | + P_("Spacing around check or radio indicator"), | ||
107 | + 0, | ||
108 | + G_MAXINT, | ||
109 | + INDICATOR_SPACING, | ||
110 | + G_PARAM_READABLE)); | ||
111 | } | ||
112 | |||
113 | static void | ||
114 | @@ -148,7 +169,8 @@ | ||
115 | GtkWidget* | ||
116 | gtk_check_button_new_with_mnemonic (const gchar *label) | ||
117 | { | ||
118 | - return g_object_new (GTK_TYPE_CHECK_BUTTON, "label", label, "use_underline", TRUE, NULL); | ||
119 | + return g_object_new (GTK_TYPE_CHECK_BUTTON, "label", label, | ||
120 | + "use_underline", TRUE, NULL); | ||
121 | } | ||
122 | |||
123 | |||
124 | @@ -163,39 +185,70 @@ | ||
125 | |||
126 | if (GTK_WIDGET_DRAWABLE (widget)) | ||
127 | { | ||
128 | - gint border_width; | ||
129 | - gint interior_focus; | ||
130 | - gint focus_width; | ||
131 | - gint focus_pad; | ||
132 | - | ||
133 | + gint border_width = 0; | ||
134 | + gint interior_focus = 0; | ||
135 | + gint focus_width = 0; | ||
136 | + gint focus_pad = 0; | ||
137 | + gint indicator_size = 0; | ||
138 | + gint indicator_spacing = 0; | ||
139 | + | ||
140 | gtk_widget_style_get (widget, | ||
141 | "interior-focus", &interior_focus, | ||
142 | "focus-line-width", &focus_width, | ||
143 | "focus-padding", &focus_pad, | ||
144 | + "indicator-size", &indicator_size, | ||
145 | + "indicator-spacing", &indicator_spacing, | ||
146 | NULL); | ||
147 | - | ||
148 | - gtk_check_button_draw_indicator (check_button, area); | ||
149 | |||
150 | border_width = GTK_CONTAINER (widget)->border_width; | ||
151 | + | ||
152 | + /* Hildon: change the focus so that it draws around the entire | ||
153 | + * widget - including both the indicator *and* the label | ||
154 | + */ | ||
155 | if (GTK_WIDGET_HAS_FOCUS (widget)) | ||
156 | { | ||
157 | GtkWidget *child = GTK_BIN (widget)->child; | ||
158 | |||
159 | + int w = indicator_size + 2 * indicator_spacing + | ||
160 | + 2 * (focus_width + focus_pad); | ||
161 | + int h = indicator_size + 2 * indicator_spacing + | ||
162 | + 2 * (focus_width + focus_pad) + 2 * HILDON_SPACING | ||
163 | + - FOCUS_TOP_PADDING; | ||
164 | + int x = widget->allocation.x; | ||
165 | + int y = widget->allocation.y + (widget->allocation.height - h)/2 | ||
166 | + + FOCUS_DOWN_PADDING; | ||
167 | + | ||
168 | + if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL) | ||
169 | + x = widget->allocation.x + widget->allocation.width - | ||
170 | + (2 * HILDON_SPACING) - (indicator_size + 2) - | ||
171 | + (indicator_spacing + 2); | ||
172 | + | ||
173 | if (interior_focus && child && GTK_WIDGET_VISIBLE (child)) | ||
174 | - gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget), | ||
175 | - NULL, widget, "checkbutton", | ||
176 | - child->allocation.x - focus_width - focus_pad, | ||
177 | - child->allocation.y - focus_width - focus_pad, | ||
178 | - child->allocation.width + 2 * (focus_width + focus_pad), | ||
179 | - child->allocation.height + 2 * (focus_width + focus_pad)); | ||
180 | + { | ||
181 | + if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL) | ||
182 | + { | ||
183 | + /* Move the "x" to the left, and enlarge the width, | ||
184 | + both accounting for the child | ||
185 | + */ | ||
186 | + x += - child->allocation.width - HILDON_SPACING - | ||
187 | + (widget->style->xthickness); | ||
188 | + w += child->allocation.width + HILDON_SPACING + | ||
189 | + (widget->style->xthickness); | ||
190 | + } else { | ||
191 | + w = child->allocation.x + child->allocation.width + | ||
192 | + 2 * widget->style->xthickness - x; | ||
193 | + } | ||
194 | + | ||
195 | + gtk_paint_focus (widget->style, widget->window, | ||
196 | + GTK_WIDGET_STATE (widget), | ||
197 | + NULL, widget, "checkbutton", x, y, w, h); | ||
198 | + } | ||
199 | else | ||
200 | - gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget), | ||
201 | - NULL, widget, "checkbutton", | ||
202 | - border_width + widget->allocation.x, | ||
203 | - border_width + widget->allocation.y, | ||
204 | - widget->allocation.width - 2 * border_width, | ||
205 | - widget->allocation.height - 2 * border_width); | ||
206 | + gtk_paint_focus (widget->style, widget->window, | ||
207 | + GTK_WIDGET_STATE (widget), | ||
208 | + NULL, widget, "checkbutton", x, y, w, h); | ||
209 | } | ||
210 | + gtk_check_button_draw_indicator (check_button, area); | ||
211 | } | ||
212 | } | ||
213 | |||
214 | @@ -205,10 +258,10 @@ | ||
215 | gint *indicator_spacing) | ||
216 | { | ||
217 | GtkWidget *widget = GTK_WIDGET (check_button); | ||
218 | - | ||
219 | + | ||
220 | if (indicator_size) | ||
221 | gtk_widget_style_get (widget, "indicator_size", indicator_size, NULL); | ||
222 | - | ||
223 | + | ||
224 | if (indicator_spacing) | ||
225 | gtk_widget_style_get (widget, "indicator_spacing", indicator_spacing, NULL); | ||
226 | } | ||
227 | @@ -233,7 +286,7 @@ | ||
228 | "focus-line-width", &focus_width, | ||
229 | "focus-padding", &focus_pad, | ||
230 | NULL); | ||
231 | - | ||
232 | + | ||
233 | requisition->width = border_width * 2; | ||
234 | requisition->height = border_width * 2; | ||
235 | |||
236 | @@ -246,15 +299,19 @@ | ||
237 | GtkRequisition child_requisition; | ||
238 | |||
239 | gtk_widget_size_request (child, &child_requisition); | ||
240 | - | ||
241 | - requisition->width += child_requisition.width + indicator_spacing; | ||
242 | + | ||
243 | + requisition->width += child_requisition.width + | ||
244 | + 2 * widget->style->xthickness; | ||
245 | requisition->height += child_requisition.height; | ||
246 | + requisition->width += 2 * widget->style->xthickness; | ||
247 | } | ||
248 | |||
249 | - requisition->width += (indicator_size + indicator_spacing * 2 + 2 * (focus_width + focus_pad)); | ||
250 | + requisition->width += (indicator_size + indicator_spacing * 2 + | ||
251 | + 2 * (focus_width + focus_pad)); | ||
252 | |||
253 | temp = indicator_size + indicator_spacing * 2; | ||
254 | - requisition->height = MAX (requisition->height, temp) + 2 * (focus_width + focus_pad); | ||
255 | + requisition->height = MAX (requisition->height, temp) + | ||
256 | + 2 * (focus_width + focus_pad); | ||
257 | } | ||
258 | else | ||
259 | (* GTK_WIDGET_CLASS (parent_class)->size_request) (widget, requisition); | ||
260 | @@ -280,45 +337,59 @@ | ||
261 | gint focus_width; | ||
262 | gint focus_pad; | ||
263 | |||
264 | - _gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing); | ||
265 | + _gtk_check_button_get_props (check_button, | ||
266 | + &indicator_size, &indicator_spacing); | ||
267 | gtk_widget_style_get (widget, | ||
268 | "focus-line-width", &focus_width, | ||
269 | "focus-padding", &focus_pad, | ||
270 | NULL); | ||
271 | - | ||
272 | + | ||
273 | widget->allocation = *allocation; | ||
274 | if (GTK_WIDGET_REALIZED (widget)) | ||
275 | gdk_window_move_resize (button->event_window, | ||
276 | allocation->x, allocation->y, | ||
277 | allocation->width, allocation->height); | ||
278 | |||
279 | - if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child)) | ||
280 | + if (GTK_BIN (button)->child && | ||
281 | + GTK_WIDGET_VISIBLE (GTK_BIN (button)->child)) | ||
282 | { | ||
283 | GtkRequisition child_requisition; | ||
284 | gint border_width = GTK_CONTAINER (widget)->border_width; | ||
285 | - | ||
286 | - gtk_widget_get_child_requisition (GTK_BIN (button)->child, &child_requisition); | ||
287 | + | ||
288 | + gtk_widget_get_child_requisition (GTK_BIN (button)->child, | ||
289 | + &child_requisition); | ||
290 | |||
291 | - child_allocation.width = MIN (child_requisition.width, | ||
292 | + child_allocation.width = MIN ( | ||
293 | + child_requisition.width, | ||
294 | allocation->width - | ||
295 | - ((border_width + focus_width + focus_pad) * 2 | ||
296 | - + indicator_size + indicator_spacing * 3)); | ||
297 | - child_allocation.width = MAX (child_allocation.width, 1); | ||
298 | + ((border_width + focus_width + | ||
299 | + focus_pad) * 2 | ||
300 | + - 2 * widget->style->xthickness + | ||
301 | + indicator_size + | ||
302 | + indicator_spacing * 2 ) ); | ||
303 | |||
304 | + child_allocation.width = MAX (child_allocation.width, 1); | ||
305 | + | ||
306 | child_allocation.height = MIN (child_requisition.height, | ||
307 | - allocation->height - (border_width + focus_width + focus_pad) * 2); | ||
308 | + allocation->height - | ||
309 | + (border_width + focus_width + | ||
310 | + focus_pad) * 2); | ||
311 | child_allocation.height = MAX (child_allocation.height, 1); | ||
312 | |||
313 | - child_allocation.x = (border_width + indicator_size + indicator_spacing * 3 + | ||
314 | - widget->allocation.x + focus_width + focus_pad); | ||
315 | + child_allocation.x = (border_width + indicator_size + | ||
316 | + indicator_spacing * 2 + | ||
317 | + widget->style->xthickness + | ||
318 | + widget->allocation.x + | ||
319 | + focus_width + focus_pad); | ||
320 | child_allocation.y = widget->allocation.y + | ||
321 | - (allocation->height - child_allocation.height) / 2; | ||
322 | - | ||
323 | + (allocation->height - child_allocation.height) / 2; | ||
324 | + | ||
325 | if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
326 | - child_allocation.x = allocation->x + allocation->width | ||
327 | - - (child_allocation.x - allocation->x + child_allocation.width); | ||
328 | + child_allocation.x = allocation->x + allocation->width - | ||
329 | + (child_allocation.x - allocation->x + child_allocation.width); | ||
330 | |||
331 | - gtk_widget_size_allocate (GTK_BIN (button)->child, &child_allocation); | ||
332 | + gtk_widget_size_allocate (GTK_BIN (button)->child, | ||
333 | + &child_allocation); | ||
334 | } | ||
335 | } | ||
336 | else | ||
337 | @@ -375,45 +446,33 @@ | ||
338 | GdkRectangle *area) | ||
339 | { | ||
340 | GtkWidget *widget; | ||
341 | - GtkWidget *child; | ||
342 | GtkButton *button; | ||
343 | GtkToggleButton *toggle_button; | ||
344 | GtkStateType state_type; | ||
345 | GtkShadowType shadow_type; | ||
346 | - gint x, y; | ||
347 | - gint indicator_size; | ||
348 | - gint indicator_spacing; | ||
349 | - gint focus_width; | ||
350 | - gint focus_pad; | ||
351 | - gboolean interior_focus; | ||
352 | + | ||
353 | + GdkRectangle indicator = {0, 0, 0, 0}; | ||
354 | |||
355 | if (GTK_WIDGET_DRAWABLE (check_button)) | ||
356 | { | ||
357 | widget = GTK_WIDGET (check_button); | ||
358 | button = GTK_BUTTON (check_button); | ||
359 | toggle_button = GTK_TOGGLE_BUTTON (check_button); | ||
360 | - | ||
361 | - gtk_widget_style_get (widget, "interior_focus", &interior_focus, | ||
362 | - "focus-line-width", &focus_width, | ||
363 | - "focus-padding", &focus_pad, NULL); | ||
364 | - | ||
365 | - _gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing); | ||
366 | - | ||
367 | - x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width; | ||
368 | - y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2; | ||
369 | - | ||
370 | - child = GTK_BIN (check_button)->child; | ||
371 | - if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child))) | ||
372 | - x += focus_width + focus_pad; | ||
373 | - | ||
374 | + gtk_check_button_calc_indicator_size( check_button, &indicator ); | ||
375 | + | ||
376 | + /* move indicator to root coordinates */ | ||
377 | + indicator.x += widget->allocation.x; | ||
378 | + indicator.y += widget->allocation.y; | ||
379 | + | ||
380 | if (toggle_button->inconsistent) | ||
381 | shadow_type = GTK_SHADOW_ETCHED_IN; | ||
382 | else if (toggle_button->active) | ||
383 | shadow_type = GTK_SHADOW_IN; | ||
384 | else | ||
385 | shadow_type = GTK_SHADOW_OUT; | ||
386 | - | ||
387 | - if (button->activate_timeout || (button->button_down && button->in_button)) | ||
388 | + | ||
389 | + if (button->activate_timeout || | ||
390 | + (button->button_down && button->in_button)) | ||
391 | state_type = GTK_STATE_ACTIVE; | ||
392 | else if (button->in_button) | ||
393 | state_type = GTK_STATE_PRELIGHT; | ||
394 | @@ -422,32 +481,107 @@ | ||
395 | else | ||
396 | state_type = GTK_STATE_NORMAL; | ||
397 | |||
398 | - if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
399 | - x = widget->allocation.x + widget->allocation.width - (indicator_size + x - widget->allocation.x); | ||
400 | + /* Hildon change. We want to draw active image always when we have | ||
401 | + * focus. */ | ||
402 | + if (GTK_WIDGET_HAS_FOCUS (widget)) | ||
403 | + state_type = GTK_STATE_ACTIVE; | ||
404 | |||
405 | - if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_PRELIGHT) | ||
406 | + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
407 | { | ||
408 | - GdkRectangle restrict_area; | ||
409 | - GdkRectangle new_area; | ||
410 | - | ||
411 | - restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width; | ||
412 | - restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width; | ||
413 | - restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width); | ||
414 | - restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width); | ||
415 | + indicator.x = widget->allocation.x + widget->allocation.width | ||
416 | + - (indicator.width + indicator.x - widget->allocation.x); | ||
417 | |||
418 | - if (gdk_rectangle_intersect (area, &restrict_area, &new_area)) | ||
419 | - { | ||
420 | - gtk_paint_flat_box (widget->style, widget->window, GTK_STATE_PRELIGHT, | ||
421 | - GTK_SHADOW_ETCHED_OUT, | ||
422 | - area, widget, "checkbutton", | ||
423 | - new_area.x, new_area.y, | ||
424 | - new_area.width, new_area.height); | ||
425 | - } | ||
426 | } | ||
427 | |||
428 | gtk_paint_check (widget->style, widget->window, | ||
429 | state_type, shadow_type, | ||
430 | area, widget, "checkbutton", | ||
431 | - x, y, indicator_size, indicator_size); | ||
432 | + indicator.x, indicator.y, | ||
433 | + indicator.width, indicator.height); | ||
434 | + } | ||
435 | +} | ||
436 | + | ||
437 | + | ||
438 | +/* calculates the size and position of the indicator | ||
439 | + * relative to the origin of the check button. | ||
440 | + */ | ||
441 | +static void gtk_check_button_calc_indicator_size( GtkCheckButton *button, | ||
442 | + GdkRectangle *rect ) | ||
443 | +{ | ||
444 | + gint indicator_size; | ||
445 | + gint indicator_spacing; | ||
446 | + gint focus_width; | ||
447 | + gint focus_pad; | ||
448 | + gboolean interior_focus; | ||
449 | + GtkWidget *child; | ||
450 | + GtkWidget *widget = GTK_WIDGET(button); | ||
451 | + | ||
452 | + | ||
453 | + gtk_widget_style_get (widget, "interior_focus", &interior_focus, | ||
454 | + "focus-line-width", &focus_width, | ||
455 | + "focus-padding", &focus_pad, | ||
456 | + "indicator-size", &indicator_size, | ||
457 | + "indicator-spacing", &indicator_spacing, | ||
458 | + NULL | ||
459 | + ); | ||
460 | + | ||
461 | + | ||
462 | + /* HILDON: We want the indicator to be positioned according to the spec. | ||
463 | + * | ||
464 | + * NOTE: INDICATOR_SIDE_PADDING and INDICATOR_TOP_PADDING | ||
465 | + * are maJiKal numbers that make the indicator to be drawn | ||
466 | + * to correct coordinates, 1337 \o/ | ||
467 | + */ | ||
468 | + rect->x = INDICATOR_SIDE_PADDING; | ||
469 | + rect->y = ( widget->allocation.height - indicator_size ) / 2; | ||
470 | + | ||
471 | + /* Hildon: we always add space for the focus */ | ||
472 | + rect->x += focus_width + focus_pad; | ||
473 | + | ||
474 | + child = GTK_BIN (widget)->child; | ||
475 | + if (interior_focus && child && GTK_WIDGET_VISIBLE (child)) | ||
476 | + { | ||
477 | + rect->y += HILDON_SPACING; | ||
478 | } | ||
479 | + | ||
480 | + rect->width = indicator_size; | ||
481 | + rect->height = indicator_size; | ||
482 | } | ||
483 | + | ||
484 | +static void | ||
485 | +gtk_check_button_clicked (GtkButton *button) | ||
486 | +{ | ||
487 | + GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button); | ||
488 | + | ||
489 | + toggle_button->active = !toggle_button->active; | ||
490 | + gtk_toggle_button_toggled (toggle_button); | ||
491 | + | ||
492 | + gtk_check_button_update_state (button); | ||
493 | + | ||
494 | + g_object_notify (G_OBJECT (toggle_button), "active"); | ||
495 | +} | ||
496 | + | ||
497 | +static void | ||
498 | +gtk_check_button_update_state (GtkButton *button) | ||
499 | +{ | ||
500 | + GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button); | ||
501 | + gboolean depressed; | ||
502 | + GtkStateType new_state; | ||
503 | + | ||
504 | + if (toggle_button->inconsistent) | ||
505 | + depressed = FALSE; | ||
506 | + else if (button->in_button && button->button_down) | ||
507 | + depressed = TRUE; | ||
508 | + else | ||
509 | + depressed = toggle_button->active; | ||
510 | + | ||
511 | + if (button->in_button && | ||
512 | + (!button->button_down || toggle_button->draw_indicator)) | ||
513 | + new_state = GTK_STATE_PRELIGHT; | ||
514 | + else | ||
515 | + new_state = depressed ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL; | ||
516 | + | ||
517 | + _gtk_button_set_depressed (button, depressed); | ||
518 | + gtk_widget_set_state (GTK_WIDGET (toggle_button), new_state); | ||
519 | +} | ||
520 | + | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcombobox.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcombobox.c.diff deleted file mode 100644 index 2376beaeaa..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcombobox.c.diff +++ /dev/null | |||
@@ -1,950 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcombobox.c 2005-02-25 21:11:08.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcombobox.c 2005-04-06 16:19:36.406003808 +0300 | ||
3 | @@ -17,6 +17,10 @@ | ||
4 | * Boston, MA 02111-1307, USA. | ||
5 | */ | ||
6 | |||
7 | +/* | ||
8 | + * Modified for Nokia Oyj during 2002-2004. | ||
9 | + */ | ||
10 | + | ||
11 | #include <config.h> | ||
12 | #include "gtkalias.h" | ||
13 | #include "gtkcombobox.h" | ||
14 | @@ -39,6 +43,8 @@ | ||
15 | #include "gtktreeselection.h" | ||
16 | #include "gtkvseparator.h" | ||
17 | #include "gtkwindow.h" | ||
18 | +#include "gtkcomboboxentry.h" | ||
19 | +#include "gtktoolbar.h" | ||
20 | |||
21 | #include <gdk/gdkkeysyms.h> | ||
22 | |||
23 | @@ -52,6 +58,13 @@ | ||
24 | |||
25 | #include "gtktreeprivate.h" | ||
26 | |||
27 | +#define HILDON_MAX_WIDTH 406 | ||
28 | +#define HILDON_MAX_HEIGHT 305 | ||
29 | +#define HILDON_MAX_ITEMS 8 | ||
30 | +/* this is also defined in gtkmenu.c and should be replaced with | ||
31 | + a style property */ | ||
32 | +#define MENU_SCROLL_ARROW_HEIGHT 20 | ||
33 | + | ||
34 | /* WELCOME, to THE house of evil code */ | ||
35 | |||
36 | typedef struct _ComboCellInfo ComboCellInfo; | ||
37 | @@ -119,6 +132,9 @@ | ||
38 | GtkTreeViewRowSeparatorFunc row_separator_func; | ||
39 | gpointer row_separator_data; | ||
40 | GtkDestroyNotify row_separator_destroy; | ||
41 | + | ||
42 | + /* Hildon hack: state of our style property */ | ||
43 | + gboolean autodimmed_button; | ||
44 | }; | ||
45 | |||
46 | /* While debugging this evil code, I have learned that | ||
47 | @@ -201,6 +217,7 @@ | ||
48 | |||
49 | #define BONUS_PADDING 4 | ||
50 | #define SCROLL_TIME 100 | ||
51 | +#define HILDON_PADDING 25 | ||
52 | |||
53 | /* common */ | ||
54 | static void gtk_combo_box_class_init (GtkComboBoxClass *klass); | ||
55 | @@ -273,6 +290,14 @@ | ||
56 | gboolean include_internals, | ||
57 | GtkCallback callback, | ||
58 | gpointer callback_data); | ||
59 | +static gboolean gtk_combo_box_focus_in (GtkWidget *widget, | ||
60 | + GdkEventFocus *event); | ||
61 | +static gint gtk_combo_box_focus (GtkWidget *widget, | ||
62 | + GtkDirectionType dir); | ||
63 | +static void gtk_combo_box_child_focus_in (GtkWidget *widget, | ||
64 | + GdkEventFocus *event); | ||
65 | +static void gtk_combo_box_child_focus_out (GtkWidget *widget, | ||
66 | + GdkEventFocus *event); | ||
67 | static gboolean gtk_combo_box_expose_event (GtkWidget *widget, | ||
68 | GdkEventExpose *event); | ||
69 | static gboolean gtk_combo_box_scroll_event (GtkWidget *widget, | ||
70 | @@ -285,6 +310,12 @@ | ||
71 | |||
72 | static void gtk_combo_box_check_appearance (GtkComboBox *combo_box); | ||
73 | |||
74 | +/* <Hildon addition> */ | ||
75 | +extern void gtk_grab_combo_box_entry_focus (GtkComboBoxEntry *entry_box); | ||
76 | + | ||
77 | +static void gtk_combo_box_grab_focus (GtkWidget *focus_widget); | ||
78 | +/* </hildon addition> */ | ||
79 | + | ||
80 | /* listening to the model */ | ||
81 | static void gtk_combo_box_model_row_inserted (GtkTreeModel *model, | ||
82 | GtkTreePath *path, | ||
83 | @@ -424,6 +455,9 @@ | ||
84 | static void gtk_combo_box_start_editing (GtkCellEditable *cell_editable, | ||
85 | GdkEvent *event); | ||
86 | |||
87 | +static void gtk_combo_box_menu_position_above (GtkMenu *menu, gint *x, | ||
88 | + gint *y, gboolean *push_in, | ||
89 | + gpointer user_data); | ||
90 | |||
91 | GType | ||
92 | gtk_combo_box_get_type (void) | ||
93 | @@ -479,6 +513,25 @@ | ||
94 | return combo_box_type; | ||
95 | } | ||
96 | |||
97 | +/* Hildon addition: Check if the button needs to be dimmed */ | ||
98 | +static void hildon_check_autodim(GtkComboBox *combo_box) | ||
99 | +{ | ||
100 | + GtkWidget *widget; | ||
101 | + GtkTreeModel *model; | ||
102 | + GtkTreeIter iter; | ||
103 | + | ||
104 | + widget = combo_box->priv->button; | ||
105 | + model = combo_box->priv->model; | ||
106 | + | ||
107 | + if (combo_box->priv->autodimmed_button && widget != NULL) | ||
108 | + { | ||
109 | + if (model && gtk_tree_model_get_iter_first(model, &iter)) | ||
110 | + gtk_widget_set_sensitive(widget, TRUE); | ||
111 | + else | ||
112 | + gtk_widget_set_sensitive(widget, FALSE); | ||
113 | + } | ||
114 | +} | ||
115 | + | ||
116 | /* common */ | ||
117 | static void | ||
118 | gtk_combo_box_class_init (GtkComboBoxClass *klass) | ||
119 | @@ -504,6 +557,11 @@ | ||
120 | widget_class->mnemonic_activate = gtk_combo_box_mnemonic_activate; | ||
121 | widget_class->style_set = gtk_combo_box_style_set; | ||
122 | widget_class->state_changed = gtk_combo_box_state_changed; | ||
123 | + | ||
124 | + /* Hildon addition */ | ||
125 | + widget_class->grab_focus = gtk_combo_box_grab_focus; | ||
126 | + widget_class->focus_in_event = gtk_combo_box_focus_in; | ||
127 | + widget_class->focus = gtk_combo_box_focus; | ||
128 | |||
129 | gtk_object_class = (GtkObjectClass *)klass; | ||
130 | gtk_object_class->destroy = gtk_combo_box_destroy; | ||
131 | @@ -687,6 +745,41 @@ | ||
132 | FALSE, | ||
133 | G_PARAM_READABLE)); | ||
134 | |||
135 | + gtk_widget_class_install_style_property (widget_class, | ||
136 | + g_param_spec_boolean ("hildonlike", | ||
137 | + _("Size request"), | ||
138 | + _("Size allocate"), | ||
139 | + FALSE, | ||
140 | + G_PARAM_READABLE)); | ||
141 | + | ||
142 | + gtk_widget_class_install_style_property (widget_class, | ||
143 | + g_param_spec_int ("arrow-height", | ||
144 | + P_("Arrow height for option menu"), | ||
145 | + P_("Sets arrow height"), | ||
146 | + 0, | ||
147 | + G_MAXINT, | ||
148 | + 28, | ||
149 | + G_PARAM_READWRITE)); | ||
150 | + | ||
151 | + gtk_widget_class_install_style_property (widget_class, | ||
152 | + g_param_spec_int ("arrow-width", | ||
153 | + P_("Arrow width for option menu"), | ||
154 | + P_("Sets arrow width"), | ||
155 | + 0, | ||
156 | + G_MAXINT, | ||
157 | + 26, | ||
158 | + G_PARAM_READWRITE)); | ||
159 | + | ||
160 | + | ||
161 | + /* Hildon hack: style property for enabling the autodimming hack */ | ||
162 | + gtk_widget_class_install_style_property ( | ||
163 | + widget_class, | ||
164 | + g_param_spec_boolean ("autodimmed_button", | ||
165 | + _("Autodimmed button"), | ||
166 | + _("Automatically dims the button if the list is empty"), | ||
167 | + FALSE, | ||
168 | + G_PARAM_READABLE)); | ||
169 | + | ||
170 | g_type_class_add_private (object_class, sizeof (GtkComboBoxPrivate)); | ||
171 | } | ||
172 | |||
173 | @@ -731,6 +824,11 @@ | ||
174 | combo_box->priv->editing_canceled = FALSE; | ||
175 | combo_box->priv->auto_scroll = FALSE; | ||
176 | combo_box->priv->focus_on_click = TRUE; | ||
177 | + | ||
178 | + /* Hildon hack: default value for our style property if it is queried before | ||
179 | + * the style is set */ | ||
180 | + combo_box->priv->autodimmed_button = FALSE; | ||
181 | + GTK_WIDGET_SET_FLAGS ( combo_box, GTK_CAN_FOCUS ); | ||
182 | } | ||
183 | |||
184 | static void | ||
185 | @@ -911,7 +1009,19 @@ | ||
186 | { | ||
187 | GtkComboBox *combo_box = GTK_COMBO_BOX (widget); | ||
188 | |||
189 | + /* Hildon hack: read the state of our style property */ | ||
190 | + gtk_widget_style_get (GTK_WIDGET(combo_box), | ||
191 | + "autodimmed_button", &(combo_box->priv->autodimmed_button), NULL); | ||
192 | + | ||
193 | gtk_combo_box_check_appearance (combo_box); | ||
194 | + | ||
195 | + /* Hildon hack: handle the dimmed state of the button in regards whether | ||
196 | + * the list is empty or not. This has to be done here because | ||
197 | + * in the callback functions of GtkTreeModel the button widget | ||
198 | + * may have not yet been set. However, we repeat this stuff in | ||
199 | + * those functions, because later the button will be set and | ||
200 | + * we want to update our state. */ | ||
201 | + hildon_check_autodim(combo_box); | ||
202 | |||
203 | if (combo_box->priv->tree_view && combo_box->priv->cell_view) | ||
204 | gtk_cell_view_set_background_color (GTK_CELL_VIEW (combo_box->priv->cell_view), | ||
205 | @@ -922,10 +1032,17 @@ | ||
206 | gtk_combo_box_button_toggled (GtkWidget *widget, | ||
207 | gpointer data) | ||
208 | { | ||
209 | + gboolean hildonlike; | ||
210 | GtkComboBox *combo_box = GTK_COMBO_BOX (data); | ||
211 | + | ||
212 | + gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, NULL); | ||
213 | |||
214 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) | ||
215 | { | ||
216 | + if (hildonlike) { | ||
217 | + gtk_combo_box_grab_focus(GTK_WIDGET(combo_box)); | ||
218 | + } | ||
219 | + | ||
220 | if (!combo_box->priv->popup_in_progress) | ||
221 | gtk_combo_box_popup (combo_box); | ||
222 | } | ||
223 | @@ -1103,7 +1220,7 @@ | ||
224 | { | ||
225 | gtk_container_remove (GTK_CONTAINER (combo_box->priv->popup_frame), | ||
226 | combo_box->priv->popup_widget); | ||
227 | - g_object_unref (combo_box->priv->popup_widget); | ||
228 | + g_object_unref (G_OBJECT (combo_box->priv->popup_widget)); | ||
229 | combo_box->priv->popup_widget = NULL; | ||
230 | } | ||
231 | |||
232 | @@ -1175,7 +1292,7 @@ | ||
233 | popup); | ||
234 | |||
235 | gtk_widget_show (popup); | ||
236 | - g_object_ref (popup); | ||
237 | + g_object_ref (G_OBJECT (popup)); | ||
238 | combo_box->priv->popup_widget = popup; | ||
239 | } | ||
240 | } | ||
241 | @@ -1250,9 +1367,13 @@ | ||
242 | GtkRequisition requisition; | ||
243 | GList *children; | ||
244 | gint screen_width; | ||
245 | + gint screen_height; | ||
246 | gint menu_xpos; | ||
247 | gint menu_ypos; | ||
248 | - gint menu_width; | ||
249 | + gint menu_width, menu_height; | ||
250 | + gint counter = 0; | ||
251 | + gint scroll_offset = 0; | ||
252 | + gint max_items = 0; | ||
253 | |||
254 | g_return_if_fail (GTK_IS_COMBO_BOX (user_data)); | ||
255 | |||
256 | @@ -1261,6 +1382,7 @@ | ||
257 | |||
258 | gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition); | ||
259 | menu_width = requisition.width; | ||
260 | + menu_height = requisition.height; | ||
261 | |||
262 | active = gtk_menu_get_active (GTK_MENU (combo_box->priv->popup_widget)); | ||
263 | gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos); | ||
264 | @@ -1275,6 +1397,11 @@ | ||
265 | } | ||
266 | |||
267 | children = GTK_MENU_SHELL (combo_box->priv->popup_widget)->children; | ||
268 | + child = children->data; | ||
269 | + gtk_widget_get_child_requisition (child, &requisition); | ||
270 | + max_items = (HILDON_MAX_HEIGHT-2*MENU_SCROLL_ARROW_HEIGHT)/requisition.height; | ||
271 | + max_items -= 1; | ||
272 | + | ||
273 | while (children) | ||
274 | { | ||
275 | child = children->data; | ||
276 | @@ -1284,27 +1411,119 @@ | ||
277 | |||
278 | if (GTK_WIDGET_VISIBLE (child)) | ||
279 | { | ||
280 | - gtk_widget_get_child_requisition (child, &requisition); | ||
281 | - menu_ypos -= requisition.height; | ||
282 | + if (counter < max_items - 2) | ||
283 | + menu_ypos -= requisition.height; | ||
284 | + if (counter > max_items - 3) | ||
285 | + scroll_offset += requisition.height; | ||
286 | } | ||
287 | - | ||
288 | + | ||
289 | + counter++; | ||
290 | children = children->next; | ||
291 | } | ||
292 | + gtk_widget_get_child_requisition (GTK_WIDGET(menu), &requisition); | ||
293 | |||
294 | + if ( requisition.height >= HILDON_MAX_HEIGHT ) | ||
295 | + menu_ypos -= MENU_SCROLL_ARROW_HEIGHT; | ||
296 | + | ||
297 | if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
298 | menu_xpos = menu_xpos + widget->allocation.width - menu_width; | ||
299 | |||
300 | + { | ||
301 | + gint menu_xpad, menu_ypad; | ||
302 | + gtk_widget_style_get (GTK_WIDGET (menu), | ||
303 | + "horizontal-padding", &menu_xpad, | ||
304 | + "vertical-padding", &menu_ypad, | ||
305 | + NULL); | ||
306 | + menu_xpos -= menu_xpad - 3; | ||
307 | + menu_ypos -= menu_ypad - 1; | ||
308 | + } | ||
309 | + | ||
310 | /* Clamp the position on screen */ | ||
311 | screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget)); | ||
312 | + screen_height = gdk_screen_get_height (gtk_widget_get_screen (widget)); | ||
313 | |||
314 | if (menu_xpos < 0) | ||
315 | menu_xpos = 0; | ||
316 | else if ((menu_xpos + menu_width) > screen_width) | ||
317 | menu_xpos -= ((menu_xpos + menu_width) - screen_width); | ||
318 | |||
319 | + if (menu_ypos + menu_height > screen_height) | ||
320 | + { | ||
321 | + menu_ypos = screen_height - menu_height; | ||
322 | + } | ||
323 | + if (menu_ypos < 0) | ||
324 | + { | ||
325 | + menu_ypos = 0; | ||
326 | + } | ||
327 | + | ||
328 | + GTK_MENU(combo_box->priv->popup_widget)->scroll_offset = scroll_offset; | ||
329 | + | ||
330 | *x = menu_xpos; | ||
331 | *y = menu_ypos; | ||
332 | |||
333 | + *push_in = FALSE; | ||
334 | +} | ||
335 | + | ||
336 | +static void | ||
337 | +gtk_combo_box_menu_position_above (GtkMenu *menu, | ||
338 | + gint *x, | ||
339 | + gint *y, | ||
340 | + gboolean *push_in, | ||
341 | + gpointer user_data) | ||
342 | +{ | ||
343 | + /* | ||
344 | + * This function positiones the menu above widgets. | ||
345 | + * This is a modified version of the position function | ||
346 | + * gtk_combo_box_position_over. | ||
347 | + * NB: This is only used when gtkcombobox is in toolbar! | ||
348 | + */ | ||
349 | + | ||
350 | + GtkWidget *child; | ||
351 | + GtkRequisition requisition; | ||
352 | + GList *children; | ||
353 | + gint screen_width; | ||
354 | + gint menu_xpos; | ||
355 | + gint menu_ypos; | ||
356 | + gint gx,gy; | ||
357 | + gint menu_width; | ||
358 | + GtkWidget *widget; | ||
359 | + | ||
360 | + widget = GTK_WIDGET(user_data); | ||
361 | + | ||
362 | + gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition); | ||
363 | + menu_width = requisition.width; | ||
364 | + | ||
365 | + gdk_window_get_position(GDK_WINDOW(widget->window), &gx, &gy); | ||
366 | + gtk_widget_translate_coordinates (widget, gtk_widget_get_toplevel(widget), | ||
367 | + gx, gy, &menu_xpos, &menu_ypos); | ||
368 | + | ||
369 | + menu_ypos -= GTK_WIDGET(menu)->style->ythickness * 2; | ||
370 | + menu_ypos -= GTK_WIDGET(widget)->style->ythickness * 2; | ||
371 | + | ||
372 | + menu_ypos -= widget->allocation.height; | ||
373 | + | ||
374 | + children = GTK_MENU_SHELL (menu)->children; | ||
375 | + while (children) { | ||
376 | + child = children->data; | ||
377 | + if (GTK_WIDGET_VISIBLE (child)){ | ||
378 | + gtk_widget_get_child_requisition (child, &requisition); | ||
379 | + menu_ypos -= requisition.height; | ||
380 | + } | ||
381 | + children = children->next; | ||
382 | + } | ||
383 | + | ||
384 | + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
385 | + menu_xpos = menu_xpos + widget->allocation.width - menu_width; | ||
386 | + | ||
387 | + screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget)); | ||
388 | + | ||
389 | + if (menu_xpos < 0) | ||
390 | + menu_xpos = 0; | ||
391 | + else if ((menu_xpos + menu_width) > screen_width) | ||
392 | + menu_xpos -= ((menu_xpos + menu_width) - screen_width); | ||
393 | + | ||
394 | + *x = menu_xpos; | ||
395 | + *y = menu_ypos; | ||
396 | *push_in = TRUE; | ||
397 | } | ||
398 | |||
399 | @@ -1318,21 +1537,44 @@ | ||
400 | GtkComboBox *combo_box; | ||
401 | GtkWidget *menu_item; | ||
402 | |||
403 | + gboolean hildonlike; | ||
404 | + | ||
405 | combo_box = GTK_COMBO_BOX (user_data); | ||
406 | |||
407 | - if (combo_box->priv->wrap_width > 0 || combo_box->priv->cell_view == NULL) | ||
408 | - gtk_combo_box_menu_position_below (menu, x, y, push_in, user_data); | ||
409 | - else | ||
410 | + gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, NULL); | ||
411 | + | ||
412 | + if (!(combo_box->priv->wrap_width > 0 || combo_box->priv->cell_view == NULL)) | ||
413 | { | ||
414 | /* FIXME handle nested menus better */ | ||
415 | menu_item = gtk_menu_get_active (GTK_MENU (combo_box->priv->popup_widget)); | ||
416 | if (menu_item) | ||
417 | gtk_menu_shell_select_item (GTK_MENU_SHELL (combo_box->priv->popup_widget), | ||
418 | menu_item); | ||
419 | + } | ||
420 | |||
421 | - gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data); | ||
422 | + if (hildonlike) | ||
423 | + { | ||
424 | + /* HILDON: we check if combobox is in a toolbar */ | ||
425 | + gboolean in_toolbar = gtk_widget_get_ancestor(GTK_WIDGET(combo_box), GTK_TYPE_TOOLBAR) != NULL; | ||
426 | + if (in_toolbar) | ||
427 | + { | ||
428 | + /*due to limits in combo's sizes we use position_over here also*/ | ||
429 | + gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data); | ||
430 | + return; | ||
431 | + } | ||
432 | } | ||
433 | |||
434 | + if (combo_box->priv->wrap_width > 0 || combo_box->priv->cell_view == NULL) | ||
435 | +/* | ||
436 | + * Changed because we always want the combo box position to be over | ||
437 | + * the combo box, unless it's in toolbar. | ||
438 | + * | ||
439 | + gtk_combo_box_menu_position_below (menu, x, y, push_in, user_data); | ||
440 | +*/ | ||
441 | + gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data); | ||
442 | + else | ||
443 | + gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data); | ||
444 | + | ||
445 | } | ||
446 | |||
447 | static void | ||
448 | @@ -1430,7 +1672,7 @@ | ||
449 | list = cells; | ||
450 | while (list) | ||
451 | { | ||
452 | - g_object_get (list->data, "sensitive", &sensitive, NULL); | ||
453 | + g_object_get (G_OBJECT (list->data), "sensitive", &sensitive, NULL); | ||
454 | |||
455 | if (sensitive) | ||
456 | break; | ||
457 | @@ -1469,7 +1711,7 @@ | ||
458 | list = cells; | ||
459 | while (list) | ||
460 | { | ||
461 | - g_object_get (list->data, "sensitive", &sensitive, NULL); | ||
462 | + g_object_get (G_OBJECT (list->data), "sensitive", &sensitive, NULL); | ||
463 | |||
464 | if (sensitive) | ||
465 | break; | ||
466 | @@ -1516,8 +1758,8 @@ | ||
467 | if (menu != combo_box->priv->popup_widget && child == children) | ||
468 | { | ||
469 | separator = GTK_WIDGET (child->next->data); | ||
470 | - g_object_set (item, "visible", sensitive, NULL); | ||
471 | - g_object_set (separator, "visible", sensitive, NULL); | ||
472 | + g_object_set (G_OBJECT (item), "visible", sensitive, NULL); | ||
473 | + g_object_set (G_OBJECT (separator), "visible", sensitive, NULL); | ||
474 | } | ||
475 | else | ||
476 | gtk_widget_set_sensitive (item, sensitive); | ||
477 | @@ -1543,16 +1785,19 @@ | ||
478 | if (gtk_tree_row_reference_valid (combo_box->priv->active_row)) | ||
479 | { | ||
480 | path = gtk_tree_row_reference_get_path (combo_box->priv->active_row); | ||
481 | - active_item = gtk_tree_path_get_indices (path)[0]; | ||
482 | - gtk_tree_path_free (path); | ||
483 | - | ||
484 | - if (combo_box->priv->add_tearoffs) | ||
485 | - active_item++; | ||
486 | + if (path) | ||
487 | + { | ||
488 | + active_item = gtk_tree_path_get_indices (path)[0]; | ||
489 | + gtk_tree_path_free (path); | ||
490 | + | ||
491 | + if (combo_box->priv->add_tearoffs) | ||
492 | + active_item++; | ||
493 | + } | ||
494 | } | ||
495 | |||
496 | /* FIXME handle nested menus better */ | ||
497 | - gtk_menu_set_active (GTK_MENU (combo_box->priv->popup_widget), active_item); | ||
498 | - | ||
499 | + gtk_menu_set_active (GTK_MENU (combo_box->priv->popup_widget), active_item); | ||
500 | + | ||
501 | if (combo_box->priv->wrap_width == 0) | ||
502 | { | ||
503 | width = GTK_WIDGET (combo_box)->allocation.width; | ||
504 | @@ -1684,6 +1929,7 @@ | ||
505 | { | ||
506 | gint padding; | ||
507 | GtkRequisition req; | ||
508 | + gboolean hildonlike; | ||
509 | |||
510 | if (combo_box->priv->cell_view) | ||
511 | gtk_widget_style_get (combo_box->priv->cell_view, | ||
512 | @@ -1691,9 +1937,17 @@ | ||
513 | NULL); | ||
514 | else | ||
515 | padding = 0; | ||
516 | + | ||
517 | + gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, | ||
518 | + NULL); | ||
519 | |||
520 | /* add some pixels for good measure */ | ||
521 | - padding += BONUS_PADDING; | ||
522 | + /* Hildon: we need more padding because our theming | ||
523 | + * Not elegent way to do it anyway ... */ | ||
524 | + if (hildonlike) | ||
525 | + padding += HILDON_PADDING; | ||
526 | + else | ||
527 | + padding += BONUS_PADDING; | ||
528 | |||
529 | if (combo_box->priv->cell_view) | ||
530 | gtk_cell_view_get_size_of_row (GTK_CELL_VIEW (combo_box->priv->cell_view), | ||
531 | @@ -1709,6 +1963,7 @@ | ||
532 | { | ||
533 | GtkTreeIter iter; | ||
534 | GtkTreePath *path; | ||
535 | + gboolean hildonlike; | ||
536 | |||
537 | if (!combo_box->priv->model || | ||
538 | !gtk_tree_model_get_iter_first (combo_box->priv->model, &iter)) | ||
539 | @@ -1717,6 +1972,7 @@ | ||
540 | combo_box->priv->width = 0; | ||
541 | |||
542 | path = gtk_tree_path_new_from_indices (0, -1); | ||
543 | + gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, NULL); | ||
544 | |||
545 | do | ||
546 | { | ||
547 | @@ -1727,8 +1983,11 @@ | ||
548 | path, &req); | ||
549 | else | ||
550 | req.width = 0; | ||
551 | + /* Hildon: we need more padding because our theming | ||
552 | + * Not elegent way to do it anyway ... */ | ||
553 | |||
554 | - combo_box->priv->width = MAX (combo_box->priv->width, req.width); | ||
555 | + combo_box->priv->width = MAX (combo_box->priv->width, | ||
556 | + req.width + (hildonlike == 1) ? HILDON_PADDING : 0 ); | ||
557 | |||
558 | gtk_tree_path_next (path); | ||
559 | } | ||
560 | @@ -1744,10 +2003,19 @@ | ||
561 | gint width, height; | ||
562 | gint focus_width, focus_pad; | ||
563 | GtkRequisition bin_req; | ||
564 | + gboolean hildonlike; | ||
565 | + gint arrow_width; | ||
566 | + gint arrow_height; | ||
567 | |||
568 | GtkComboBox *combo_box = GTK_COMBO_BOX (widget); | ||
569 | |||
570 | gtk_combo_box_check_appearance (combo_box); | ||
571 | + | ||
572 | + /* get hildonlike style property */ | ||
573 | + gtk_widget_style_get (widget, "hildonlike", | ||
574 | + &hildonlike, "arrow-width", | ||
575 | + &arrow_width, "arrow-height", | ||
576 | + &arrow_height, NULL); | ||
577 | |||
578 | /* common */ | ||
579 | gtk_widget_size_request (GTK_BIN (widget)->child, &bin_req); | ||
580 | @@ -1829,6 +2097,13 @@ | ||
581 | requisition->height = MAX (requisition->height, button_req.height); | ||
582 | requisition->width += button_req.width; | ||
583 | } | ||
584 | + | ||
585 | + requisition->width = MIN (requisition->width, HILDON_MAX_WIDTH); | ||
586 | + | ||
587 | + /* HILDON quick fix: height forced to be 28px as specified by Hildon specs. */ | ||
588 | + if (hildonlike) | ||
589 | + if (requisition->height > arrow_height) | ||
590 | + requisition->height = arrow_height; | ||
591 | } | ||
592 | |||
593 | static void | ||
594 | @@ -1839,17 +2114,32 @@ | ||
595 | gint focus_width, focus_pad; | ||
596 | GtkAllocation child; | ||
597 | GtkRequisition req; | ||
598 | + GtkRequisition child_req; | ||
599 | gboolean is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL; | ||
600 | + gboolean hildonlike; | ||
601 | + gint arrow_width; | ||
602 | + gint arrow_height; | ||
603 | |||
604 | gtk_combo_box_check_appearance (combo_box); | ||
605 | |||
606 | - widget->allocation = *allocation; | ||
607 | - | ||
608 | gtk_widget_style_get (GTK_WIDGET (widget), | ||
609 | "focus-line-width", &focus_width, | ||
610 | "focus-padding", &focus_pad, | ||
611 | + "hildonlike", &hildonlike, | ||
612 | + "arrow-width", &arrow_width, | ||
613 | + "arrow-height", &arrow_height, | ||
614 | NULL); | ||
615 | |||
616 | + /* HILDON: set height to fixed value */ | ||
617 | + if (hildonlike) | ||
618 | + if (allocation->height > arrow_height) | ||
619 | + { | ||
620 | + allocation->y += (allocation->height - arrow_height) / 2; | ||
621 | + allocation->height = arrow_height; | ||
622 | + } | ||
623 | + | ||
624 | + widget->allocation = *allocation; | ||
625 | + | ||
626 | if (!combo_box->priv->tree_view) | ||
627 | { | ||
628 | if (combo_box->priv->cell_view) | ||
629 | @@ -1909,7 +2199,16 @@ | ||
630 | child.width = child.x; | ||
631 | child.x = allocation->x | ||
632 | + border_width + xthickness + focus_width + focus_pad; | ||
633 | - child.width -= child.x; | ||
634 | + child.width -= child.x + xthickness; | ||
635 | + } | ||
636 | + | ||
637 | + if (hildonlike) | ||
638 | + { | ||
639 | + gtk_widget_size_request(GTK_BIN(widget)->child, &child_req); | ||
640 | + child.y += (child.height - child_req.height) / 2; | ||
641 | + child.height = child_req.height; | ||
642 | + gtk_widget_hide(combo_box->priv->separator); | ||
643 | + gtk_widget_hide(combo_box->priv->arrow); | ||
644 | } | ||
645 | |||
646 | child.width = MAX (1, child.width); | ||
647 | @@ -1928,6 +2227,11 @@ | ||
648 | child.height = allocation->height; | ||
649 | child.width = MAX (1, child.width); | ||
650 | child.height = MAX (1, child.height); | ||
651 | + | ||
652 | + /* HILDON quick fix */ | ||
653 | + if (hildonlike) | ||
654 | + child.width = arrow_width; | ||
655 | + | ||
656 | gtk_widget_size_allocate (combo_box->priv->button, &child); | ||
657 | |||
658 | if (is_rtl) | ||
659 | @@ -1938,6 +2242,13 @@ | ||
660 | child.width = allocation->width - req.width; | ||
661 | child.width = MAX (1, child.width); | ||
662 | child.height = MAX (1, child.height); | ||
663 | + | ||
664 | + if (hildonlike) | ||
665 | + { | ||
666 | + gtk_widget_size_request(GTK_BIN(widget)->child, &child_req); | ||
667 | + child.y += (child.height - child_req.height) / 2; | ||
668 | + child.height = child_req.height; | ||
669 | + } | ||
670 | gtk_widget_size_allocate (GTK_BIN (widget)->child, &child); | ||
671 | } | ||
672 | } | ||
673 | @@ -1990,6 +2301,11 @@ | ||
674 | GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness); | ||
675 | } | ||
676 | } | ||
677 | + | ||
678 | + gtk_widget_size_request(GTK_BIN(widget)->child, &child_req); | ||
679 | + | ||
680 | + child.y += (child.height - child_req.height) / 2; | ||
681 | + child.height = child_req.height; | ||
682 | |||
683 | child.width = MAX (1, child.width); | ||
684 | child.height = MAX (1, child.height); | ||
685 | @@ -2036,6 +2352,8 @@ | ||
686 | gtk_cell_view_set_displayed_row (GTK_CELL_VIEW (combo_box->priv->cell_view), NULL); | ||
687 | } | ||
688 | |||
689 | + | ||
690 | + | ||
691 | static void | ||
692 | gtk_combo_box_forall (GtkContainer *container, | ||
693 | gboolean include_internals, | ||
694 | @@ -2057,6 +2375,46 @@ | ||
695 | } | ||
696 | |||
697 | static gboolean | ||
698 | +gtk_combo_box_focus_in (GtkWidget *widget, | ||
699 | + GdkEventFocus *event) | ||
700 | +{ | ||
701 | + g_return_val_if_fail( widget, FALSE ); | ||
702 | + | ||
703 | + if ( !GTK_CONTAINER( widget )->focus_child ) | ||
704 | + { | ||
705 | + gtk_combo_box_grab_focus ( GTK_WIDGET(widget) ); | ||
706 | + return TRUE; | ||
707 | + } | ||
708 | + return FALSE; | ||
709 | +} | ||
710 | + | ||
711 | +static gint | ||
712 | +gtk_combo_box_focus (GtkWidget *widget, | ||
713 | + GtkDirectionType dir) | ||
714 | +{ | ||
715 | + g_return_val_if_fail (widget, FALSE); | ||
716 | + if (GTK_WIDGET_HAS_FOCUS(widget)||GTK_CONTAINER(widget)->focus_child) | ||
717 | + return FALSE; | ||
718 | + | ||
719 | + gtk_widget_grab_focus (widget); | ||
720 | + return TRUE; | ||
721 | +} | ||
722 | + | ||
723 | +static void | ||
724 | +gtk_combo_box_child_focus_in (GtkWidget * widget, | ||
725 | + GdkEventFocus *event) | ||
726 | +{ | ||
727 | + gtk_widget_event( widget, (GdkEvent*)event ); | ||
728 | +} | ||
729 | + | ||
730 | +static void | ||
731 | +gtk_combo_box_child_focus_out (GtkWidget * widget, | ||
732 | + GdkEventFocus *event) | ||
733 | +{ | ||
734 | + gtk_widget_event( widget, (GdkEvent*)event ); | ||
735 | +} | ||
736 | + | ||
737 | +static gboolean | ||
738 | gtk_combo_box_expose_event (GtkWidget *widget, | ||
739 | GdkEventExpose *event) | ||
740 | { | ||
741 | @@ -2357,11 +2715,13 @@ | ||
742 | gboolean add_children) | ||
743 | { | ||
744 | GtkWidget *menu; | ||
745 | + gboolean hildonlike; | ||
746 | + | ||
747 | + gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, NULL); | ||
748 | |||
749 | if (combo_box->priv->cell_view) | ||
750 | { | ||
751 | combo_box->priv->button = gtk_toggle_button_new (); | ||
752 | - | ||
753 | g_signal_connect (combo_box->priv->button, "toggled", | ||
754 | G_CALLBACK (gtk_combo_box_button_toggled), combo_box); | ||
755 | g_signal_connect_after (combo_box->priv->button, | ||
756 | @@ -2400,6 +2760,9 @@ | ||
757 | gtk_widget_show_all (combo_box->priv->button); | ||
758 | } | ||
759 | |||
760 | + g_signal_connect_swapped (combo_box->priv->button, "focus_in_event", G_CALLBACK (gtk_combo_box_child_focus_in), combo_box); | ||
761 | + g_signal_connect_swapped (combo_box->priv->button, "focus_out_event", G_CALLBACK (gtk_combo_box_child_focus_out), combo_box); | ||
762 | + | ||
763 | g_signal_connect (combo_box->priv->button, "button_press_event", | ||
764 | G_CALLBACK (gtk_combo_box_menu_button_press), | ||
765 | combo_box); | ||
766 | @@ -2749,6 +3112,9 @@ | ||
767 | { | ||
768 | GtkComboBox *combo_box = GTK_COMBO_BOX (user_data); | ||
769 | |||
770 | + /* Hildon hack: sets the popup button sensitive if we have items in the list */ | ||
771 | + hildon_check_autodim(combo_box); | ||
772 | + | ||
773 | gtk_tree_row_reference_inserted (G_OBJECT (user_data), path); | ||
774 | |||
775 | if (combo_box->priv->tree_view) | ||
776 | @@ -2783,7 +3149,10 @@ | ||
777 | if (combo_box->priv->tree_view) | ||
778 | gtk_combo_box_list_popup_resize (combo_box); | ||
779 | else | ||
780 | - gtk_combo_box_menu_row_deleted (model, path, user_data); | ||
781 | + gtk_combo_box_menu_row_deleted (model, path, user_data); | ||
782 | + | ||
783 | + /* Hildon hack: dim the popup button in case item count reaches 0 */ | ||
784 | + hildon_check_autodim(combo_box); | ||
785 | } | ||
786 | |||
787 | static void | ||
788 | @@ -3458,10 +3827,46 @@ | ||
789 | gboolean found; | ||
790 | GtkTreeIter iter; | ||
791 | GtkTreeIter new_iter; | ||
792 | + gboolean hildonlike; | ||
793 | + gint index = gtk_combo_box_get_active (combo_box); | ||
794 | + gint new_index; | ||
795 | + gint items = 0; | ||
796 | |||
797 | if (combo_box->priv->model == NULL) | ||
798 | return FALSE; | ||
799 | |||
800 | + items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL); | ||
801 | + | ||
802 | + gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", | ||
803 | + &hildonlike, NULL); | ||
804 | + | ||
805 | + /* Hildon select key */ | ||
806 | + if (hildonlike) | ||
807 | + { | ||
808 | + if (event->keyval == GDK_KP_Enter || event->keyval == GDK_Return) | ||
809 | + { | ||
810 | + gtk_combo_box_popup (combo_box); | ||
811 | + return TRUE; | ||
812 | + } | ||
813 | + else if (event->keyval == GDK_Left && items != 0) | ||
814 | + { | ||
815 | + new_index = (index == 0) ? items - 1 : index - 1; | ||
816 | + gtk_combo_box_set_active (combo_box, new_index); | ||
817 | + return TRUE; | ||
818 | + } | ||
819 | + else if (event->keyval == GDK_Right && items != 0) | ||
820 | + { | ||
821 | + new_index = (index == items - 1) ? 0 : index + 1; | ||
822 | + gtk_combo_box_set_active (combo_box, new_index); | ||
823 | + return TRUE; | ||
824 | + } | ||
825 | + else if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down) | ||
826 | + || (event->keyval == GDK_Up || event->keyval == GDK_KP_Up)) | ||
827 | + { | ||
828 | + return FALSE; | ||
829 | + } | ||
830 | + } | ||
831 | + | ||
832 | if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down) && | ||
833 | state == GDK_MOD1_MASK) | ||
834 | { | ||
835 | @@ -3714,7 +4119,7 @@ | ||
836 | |||
837 | combo_box = GTK_COMBO_BOX (layout); | ||
838 | |||
839 | - g_object_ref (cell); | ||
840 | + g_object_ref (G_OBJECT (cell)); | ||
841 | gtk_object_sink (GTK_OBJECT (cell)); | ||
842 | |||
843 | info = g_new0 (ComboCellInfo, 1); | ||
844 | @@ -3771,7 +4176,7 @@ | ||
845 | |||
846 | combo_box = GTK_COMBO_BOX (layout); | ||
847 | |||
848 | - g_object_ref (cell); | ||
849 | + g_object_ref (G_OBJECT (cell)); | ||
850 | gtk_object_sink (GTK_OBJECT (cell)); | ||
851 | |||
852 | info = g_new0 (ComboCellInfo, 1); | ||
853 | @@ -3833,7 +4238,7 @@ | ||
854 | ComboCellInfo *info = (ComboCellInfo *)i->data; | ||
855 | |||
856 | gtk_combo_box_cell_layout_clear_attributes (layout, info->cell); | ||
857 | - g_object_unref (info->cell); | ||
858 | + g_object_unref (G_OBJECT (info->cell)); | ||
859 | g_free (info); | ||
860 | i->data = NULL; | ||
861 | } | ||
862 | @@ -3922,7 +4327,7 @@ | ||
863 | |||
864 | if (GTK_IS_MENU_ITEM (parent) && | ||
865 | gtk_menu_item_get_submenu (GTK_MENU_ITEM (parent))) | ||
866 | - g_object_set (cell, "sensitive", TRUE, NULL); | ||
867 | + g_object_set (G_OBJECT (cell), "sensitive", TRUE, NULL); | ||
868 | } | ||
869 | |||
870 | |||
871 | @@ -4137,7 +4542,7 @@ | ||
872 | GtkWidget * | ||
873 | gtk_combo_box_new (void) | ||
874 | { | ||
875 | - return g_object_new (GTK_TYPE_COMBO_BOX, NULL); | ||
876 | + return GTK_WIDGET (g_object_new (GTK_TYPE_COMBO_BOX, NULL)); | ||
877 | } | ||
878 | |||
879 | /** | ||
880 | @@ -4157,7 +4562,9 @@ | ||
881 | |||
882 | g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL); | ||
883 | |||
884 | - combo_box = g_object_new (GTK_TYPE_COMBO_BOX, "model", model, NULL); | ||
885 | + combo_box = GTK_COMBO_BOX (g_object_new (GTK_TYPE_COMBO_BOX, | ||
886 | + "model", model, | ||
887 | + NULL)); | ||
888 | |||
889 | return GTK_WIDGET (combo_box); | ||
890 | } | ||
891 | @@ -4512,6 +4919,7 @@ | ||
892 | if (!model) | ||
893 | { | ||
894 | gtk_combo_box_unset_model (combo_box); | ||
895 | + hildon_check_autodim(combo_box); | ||
896 | return; | ||
897 | } | ||
898 | |||
899 | @@ -4524,7 +4932,7 @@ | ||
900 | gtk_combo_box_unset_model (combo_box); | ||
901 | |||
902 | combo_box->priv->model = model; | ||
903 | - g_object_ref (combo_box->priv->model); | ||
904 | + g_object_ref (G_OBJECT (combo_box->priv->model)); | ||
905 | |||
906 | combo_box->priv->inserted_id = | ||
907 | g_signal_connect (combo_box->priv->model, "row_inserted", | ||
908 | @@ -4561,6 +4969,8 @@ | ||
909 | if (combo_box->priv->cell_view) | ||
910 | gtk_cell_view_set_model (GTK_CELL_VIEW (combo_box->priv->cell_view), | ||
911 | combo_box->priv->model); | ||
912 | + | ||
913 | + hildon_check_autodim(combo_box); | ||
914 | } | ||
915 | |||
916 | /** | ||
917 | @@ -5140,3 +5550,33 @@ | ||
918 | |||
919 | return combo->priv->focus_on_click; | ||
920 | } | ||
921 | +/* Hildon addition: | ||
922 | + * This is added, because we need to be able grab focus for our widget. | ||
923 | + * Focus grabbing can happen it two ways: If we are using combobox entry | ||
924 | + * we grab entry widget focus, otherwise togglebutton focus | ||
925 | + */ | ||
926 | +static void gtk_combo_box_grab_focus (GtkWidget *focus_widget) | ||
927 | +{ | ||
928 | + GtkComboBox *combo_box; | ||
929 | + GtkComboBoxEntry *combo_entry; | ||
930 | + gboolean hildonlike; | ||
931 | + | ||
932 | + combo_box = GTK_COMBO_BOX (focus_widget); | ||
933 | + | ||
934 | + gtk_widget_style_get (focus_widget, "hildonlike", | ||
935 | + &hildonlike, NULL); | ||
936 | + | ||
937 | + if (hildonlike) | ||
938 | + { | ||
939 | + /* Are we in entry mode ? */ | ||
940 | + if ( GTK_IS_COMBO_BOX_ENTRY(combo_box)) | ||
941 | + { | ||
942 | + combo_entry = GTK_COMBO_BOX_ENTRY (combo_box); | ||
943 | + gtk_grab_combo_box_entry_focus (combo_entry); | ||
944 | + } | ||
945 | + else | ||
946 | + { | ||
947 | + gtk_widget_grab_focus (combo_box->priv->button); | ||
948 | + } | ||
949 | + } | ||
950 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcomboboxentry.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcomboboxentry.c.diff deleted file mode 100644 index 43a861abd6..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcomboboxentry.c.diff +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcomboboxentry.c 2004-11-20 01:18:37.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcomboboxentry.c 2005-04-06 16:19:36.407003656 +0300 | ||
3 | @@ -55,6 +55,8 @@ | ||
4 | gpointer user_data); | ||
5 | static gboolean gtk_combo_box_entry_mnemonic_activate (GtkWidget *entry, | ||
6 | gboolean group_cycling); | ||
7 | +/*static void gtk_grab_combo_box_entry_focus (GtkComboBoxEntry *entry_box);*/ | ||
8 | + | ||
9 | static void has_frame_changed (GtkComboBoxEntry *entry_box, | ||
10 | GParamSpec *pspec, | ||
11 | gpointer data); | ||
12 | @@ -382,3 +384,12 @@ | ||
13 | |||
14 | return entry_box; | ||
15 | } | ||
16 | + | ||
17 | +/* Hildon: this is added because we need to grab focus from caption control | ||
18 | + * to ComboBox entry. | ||
19 | + */ | ||
20 | +void | ||
21 | +gtk_grab_combo_box_entry_focus (GtkComboBoxEntry *entry_box) | ||
22 | +{ | ||
23 | + gtk_widget_grab_focus (entry_box->priv->entry); | ||
24 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcontainer.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcontainer.c.diff deleted file mode 100644 index abd251bdcb..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkcontainer.c.diff +++ /dev/null | |||
@@ -1,284 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkcontainer.c 2005-03-01 08:28:55.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkcontainer.c 2005-04-06 16:19:36.410003200 +0300 | ||
3 | @@ -37,10 +37,13 @@ | ||
4 | #include "gtkwindow.h" | ||
5 | #include "gtkintl.h" | ||
6 | #include "gtktoolbar.h" | ||
7 | +#include "gtkmenu.h" | ||
8 | +#include "gtkentry.h" | ||
9 | +#include "gtktextview.h" | ||
10 | +#include "gtkwidget.h" | ||
11 | #include <gobject/gobjectnotifyqueue.c> | ||
12 | #include <gobject/gvaluecollector.h> | ||
13 | |||
14 | - | ||
15 | enum { | ||
16 | ADD, | ||
17 | REMOVE, | ||
18 | @@ -56,6 +59,19 @@ | ||
19 | PROP_CHILD | ||
20 | }; | ||
21 | |||
22 | +enum { | ||
23 | + FOCUS_MOVE_OK, | ||
24 | + FOCUS_MOVE_OK_NO_MOVE, | ||
25 | + FOCUS_MOVE_FAIL_NO_TEXT | ||
26 | +}; | ||
27 | + | ||
28 | +typedef struct | ||
29 | +{ | ||
30 | + GtkWidget *menu; | ||
31 | + void *func; | ||
32 | + GtkWidgetTapAndHoldFlags flags; | ||
33 | +} GtkContainerTAH; | ||
34 | + | ||
35 | #define PARAM_SPEC_PARAM_ID(pspec) ((pspec)->param_id) | ||
36 | #define PARAM_SPEC_SET_PARAM_ID(pspec, id) ((pspec)->param_id = (id)) | ||
37 | |||
38 | @@ -87,6 +103,9 @@ | ||
39 | static gboolean gtk_container_focus_move (GtkContainer *container, | ||
40 | GList *children, | ||
41 | GtkDirectionType direction); | ||
42 | +static gint gtk_container_focus_move_with_tab (GtkContainer *container, | ||
43 | + GtkDirectionType direction, | ||
44 | + GtkWidget **fallback); | ||
45 | static void gtk_container_children_callback (GtkWidget *widget, | ||
46 | gpointer client_data); | ||
47 | static void gtk_container_show_all (GtkWidget *widget); | ||
48 | @@ -95,10 +114,14 @@ | ||
49 | GdkEventExpose *event); | ||
50 | static void gtk_container_map (GtkWidget *widget); | ||
51 | static void gtk_container_unmap (GtkWidget *widget); | ||
52 | - | ||
53 | +static void gtk_container_tap_and_hold_setup (GtkWidget *widget, | ||
54 | + GtkWidget *menu, GtkCallback func, GtkWidgetTapAndHoldFlags flags); | ||
55 | static gchar* gtk_container_child_default_composite_name (GtkContainer *container, | ||
56 | GtkWidget *child); | ||
57 | +static void gtk_container_tap_and_hold_setup_forall( GtkWidget *widget, | ||
58 | + GtkContainerTAH *tah ); | ||
59 | |||
60 | +static void gtk_container_grab_focus( GtkWidget *focus_widget ); | ||
61 | |||
62 | /* --- variables --- */ | ||
63 | static const gchar vadjustment_key[] = "gtk-vadjustment"; | ||
64 | @@ -190,7 +213,9 @@ | ||
65 | widget_class->map = gtk_container_map; | ||
66 | widget_class->unmap = gtk_container_unmap; | ||
67 | widget_class->focus = gtk_container_focus; | ||
68 | - | ||
69 | + widget_class->tap_and_hold_setup = gtk_container_tap_and_hold_setup; | ||
70 | + widget_class->grab_focus = gtk_container_grab_focus; | ||
71 | + | ||
72 | class->add = gtk_container_add_unimplemented; | ||
73 | class->remove = gtk_container_remove_unimplemented; | ||
74 | class->check_resize = gtk_container_real_check_resize; | ||
75 | @@ -2011,6 +2036,24 @@ | ||
76 | GtkWidget *focus_child; | ||
77 | GtkWidget *child; | ||
78 | |||
79 | + /* | ||
80 | + * If there's an item focus already and tab was pressed, only go thru | ||
81 | + * GtkEntries and GtkTextviews. Do _not_ jump from last widget to the first | ||
82 | + * one and vice verca. | ||
83 | + */ | ||
84 | + if ((direction == GTK_DIR_TAB_FORWARD || direction == GTK_DIR_TAB_BACKWARD) && | ||
85 | + container->focus_child != NULL) | ||
86 | + { | ||
87 | + GtkWidget *fallback; | ||
88 | + fallback = NULL; | ||
89 | + if (gtk_container_focus_move_with_tab (container, direction, &fallback) | ||
90 | + != FOCUS_MOVE_FAIL_NO_TEXT) | ||
91 | + return TRUE; | ||
92 | + | ||
93 | + if (fallback && gtk_widget_child_focus (fallback, direction)) | ||
94 | + return TRUE; | ||
95 | + } | ||
96 | + | ||
97 | focus_child = container->focus_child; | ||
98 | |||
99 | while (children) | ||
100 | @@ -2019,7 +2062,7 @@ | ||
101 | children = children->next; | ||
102 | |||
103 | if (!child) | ||
104 | - continue; | ||
105 | + continue; | ||
106 | |||
107 | if (focus_child) | ||
108 | { | ||
109 | @@ -2027,8 +2070,8 @@ | ||
110 | { | ||
111 | focus_child = NULL; | ||
112 | |||
113 | - if (gtk_widget_child_focus (child, direction)) | ||
114 | - return TRUE; | ||
115 | + if (gtk_widget_child_focus (child, direction)) | ||
116 | + return TRUE; | ||
117 | } | ||
118 | } | ||
119 | else if (GTK_WIDGET_DRAWABLE (child) && | ||
120 | @@ -2042,6 +2085,105 @@ | ||
121 | return FALSE; | ||
122 | } | ||
123 | |||
124 | +static gint | ||
125 | +gtk_container_focus_move_with_tab (GtkContainer *container, | ||
126 | + GtkDirectionType direction, | ||
127 | + GtkWidget **fallback) | ||
128 | +{ | ||
129 | + GList *children, *sorted_children; | ||
130 | + GtkWidget *child; | ||
131 | + GtkWidget *focus_child; | ||
132 | + gboolean found_text; | ||
133 | + gint ret; | ||
134 | + | ||
135 | + found_text = FALSE; | ||
136 | + focus_child = container->focus_child; | ||
137 | + | ||
138 | + /* This part is copied from gtk_container_focus() */ | ||
139 | + if (container->has_focus_chain) | ||
140 | + children = g_list_copy (get_focus_chain (container)); | ||
141 | + else | ||
142 | + children = gtk_container_get_all_children (container); | ||
143 | + | ||
144 | + if (container->has_focus_chain && | ||
145 | + (direction == GTK_DIR_TAB_FORWARD || | ||
146 | + direction == GTK_DIR_TAB_BACKWARD)) | ||
147 | + { | ||
148 | + sorted_children = g_list_copy (children); | ||
149 | + | ||
150 | + if (direction == GTK_DIR_TAB_BACKWARD) | ||
151 | + sorted_children = g_list_reverse (sorted_children); | ||
152 | + } | ||
153 | + else | ||
154 | + sorted_children = _gtk_container_focus_sort (container, children, | ||
155 | + direction, NULL); | ||
156 | + g_list_free(children); | ||
157 | + children = sorted_children; | ||
158 | + | ||
159 | + while (children) | ||
160 | + { | ||
161 | + child = children->data; | ||
162 | + children = children->next; | ||
163 | + | ||
164 | + if (!child) | ||
165 | + continue; | ||
166 | + | ||
167 | + if (GTK_IS_ENTRY (child) || GTK_IS_TEXT_VIEW (child)) | ||
168 | + found_text = TRUE; | ||
169 | + | ||
170 | + if (focus_child) | ||
171 | + { | ||
172 | + if (child == focus_child) | ||
173 | + { | ||
174 | + focus_child = NULL; | ||
175 | + if (GTK_IS_CONTAINER (child)) | ||
176 | + { | ||
177 | + ret = gtk_container_focus_move_with_tab (GTK_CONTAINER (child), | ||
178 | + direction, | ||
179 | + fallback); | ||
180 | + if (ret == FOCUS_MOVE_OK) | ||
181 | + { | ||
182 | + g_list_free (sorted_children); | ||
183 | + return FOCUS_MOVE_OK; | ||
184 | + } | ||
185 | + else if (ret == FOCUS_MOVE_OK_NO_MOVE) | ||
186 | + found_text = TRUE; | ||
187 | + } | ||
188 | + } | ||
189 | + } | ||
190 | + else if (GTK_WIDGET_DRAWABLE (child) && | ||
191 | + gtk_widget_is_ancestor (child, GTK_WIDGET (container))) | ||
192 | + { | ||
193 | + if (GTK_IS_ENTRY (child) || GTK_IS_TEXT_VIEW (child)) | ||
194 | + { | ||
195 | + if (gtk_widget_child_focus (child, direction)) | ||
196 | + { | ||
197 | + g_list_free (sorted_children); | ||
198 | + return FOCUS_MOVE_OK; | ||
199 | + } | ||
200 | + } | ||
201 | + else if (GTK_IS_CONTAINER (child)) | ||
202 | + { | ||
203 | + ret = gtk_container_focus_move_with_tab (GTK_CONTAINER (child), | ||
204 | + direction, | ||
205 | + fallback); | ||
206 | + if (ret == FOCUS_MOVE_OK) | ||
207 | + { | ||
208 | + g_list_free (sorted_children); | ||
209 | + return FOCUS_MOVE_OK; | ||
210 | + } | ||
211 | + else if (ret == FOCUS_MOVE_OK_NO_MOVE) | ||
212 | + found_text = TRUE; | ||
213 | + } | ||
214 | + if (GTK_WIDGET_CAN_FOCUS (child) && *fallback == NULL) | ||
215 | + *fallback = child; | ||
216 | + } | ||
217 | + } | ||
218 | + | ||
219 | + g_list_free (sorted_children); | ||
220 | + | ||
221 | + return found_text ? FOCUS_MOVE_OK_NO_MOVE : FOCUS_MOVE_FAIL_NO_TEXT; | ||
222 | +} | ||
223 | |||
224 | static void | ||
225 | gtk_container_children_callback (GtkWidget *widget, | ||
226 | @@ -2463,3 +2605,58 @@ | ||
227 | gdk_event_free (child_event); | ||
228 | } | ||
229 | } | ||
230 | + | ||
231 | +static void gtk_container_tap_and_hold_setup_forall( GtkWidget *widget, | ||
232 | + GtkContainerTAH *tah ) | ||
233 | +{ | ||
234 | + gtk_widget_tap_and_hold_setup( widget, tah->menu, tah->func, | ||
235 | + tah->flags ); | ||
236 | +} | ||
237 | + | ||
238 | +static void gtk_container_tap_and_hold_setup( GtkWidget *widget, | ||
239 | + GtkWidget *menu, GtkCallback func, GtkWidgetTapAndHoldFlags flags ) | ||
240 | +{ | ||
241 | + GtkContainerTAH tah; | ||
242 | + g_return_if_fail( GTK_IS_WIDGET(widget)); | ||
243 | + g_return_if_fail( menu == NULL || GTK_IS_MENU(menu) ); | ||
244 | + tah.menu = menu; | ||
245 | + tah.func = func; | ||
246 | + tah.flags = flags; | ||
247 | + if (flags & GTK_TAP_AND_HOLD_NO_INTERNALS) | ||
248 | + gtk_container_foreach( GTK_CONTAINER(widget), | ||
249 | + (GtkCallback)gtk_container_tap_and_hold_setup_forall, &tah ); | ||
250 | + else | ||
251 | + gtk_container_forall( GTK_CONTAINER(widget), | ||
252 | + (GtkCallback)gtk_container_tap_and_hold_setup_forall, &tah ); | ||
253 | + parent_class->tap_and_hold_setup (widget, menu, func, flags); | ||
254 | +} | ||
255 | + | ||
256 | +static void gtk_container_grab_focus( GtkWidget *focus_widget ) | ||
257 | +{ | ||
258 | + if( GTK_WIDGET_CAN_FOCUS(focus_widget) ) | ||
259 | + parent_class->grab_focus( focus_widget ); | ||
260 | + else | ||
261 | + { | ||
262 | + GList *first = NULL; | ||
263 | + GList *children = NULL; | ||
264 | + GtkWidget *old_focus = NULL; | ||
265 | + GtkWidget *toplevel = NULL; | ||
266 | + | ||
267 | + toplevel = gtk_widget_get_toplevel( focus_widget ); | ||
268 | + if( !GTK_IS_WINDOW(toplevel) ) | ||
269 | + return; | ||
270 | + | ||
271 | + old_focus = GTK_WINDOW(toplevel)->focus_widget; | ||
272 | + first = gtk_container_get_all_children( | ||
273 | + GTK_CONTAINER(focus_widget) ); | ||
274 | + children = g_list_last( first ); | ||
275 | + | ||
276 | + while( children && GTK_WINDOW(toplevel)->focus_widget == old_focus ) | ||
277 | + { | ||
278 | + gtk_widget_grab_focus( GTK_WIDGET(children->data) ); | ||
279 | + children = children->prev; | ||
280 | + } | ||
281 | + g_list_free( first ); | ||
282 | + } | ||
283 | +} | ||
284 | + | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkdialog.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkdialog.c.diff deleted file mode 100644 index 39ecdf209b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkdialog.c.diff +++ /dev/null | |||
@@ -1,451 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkdialog.c 2005-01-20 21:52:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkdialog.c 2005-04-06 16:19:36.416002288 +0300 | ||
3 | @@ -24,6 +24,9 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2002-2003. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | #include <config.h> | ||
11 | #include "gtkalias.h" | ||
12 | #include "gtkbutton.h" | ||
13 | @@ -37,11 +40,14 @@ | ||
14 | #include "gtkmain.h" | ||
15 | #include "gtkintl.h" | ||
16 | #include "gtkbindings.h" | ||
17 | +#include "gtkalignment.h" | ||
18 | |||
19 | #define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_DIALOG, GtkDialogPrivate)) | ||
20 | |||
21 | typedef struct { | ||
22 | guint ignore_separator : 1; | ||
23 | + GtkWidget *first; | ||
24 | + GtkWidget *last; | ||
25 | } GtkDialogPrivate; | ||
26 | |||
27 | typedef struct _ResponseData ResponseData; | ||
28 | @@ -77,7 +83,18 @@ | ||
29 | static void gtk_dialog_close (GtkDialog *dialog); | ||
30 | |||
31 | static ResponseData* get_response_data (GtkWidget *widget, | ||
32 | - gboolean create); | ||
33 | + gboolean create); | ||
34 | + | ||
35 | +static gboolean gtk_dialog_handle_focus (GtkWidget *widget, | ||
36 | + GtkDirectionType dir, | ||
37 | + gpointer user_data); | ||
38 | + | ||
39 | +static gboolean gtk_dialog_move_to_next_active_button (GList *iter, | ||
40 | + gboolean forward); | ||
41 | + | ||
42 | +static GtkWidget *gtk_dialog_get_first_sensitive (GList *list); | ||
43 | +static GtkWidget *gtk_dialog_get_last_sensitive (GList *list); | ||
44 | + | ||
45 | |||
46 | enum { | ||
47 | PROP_0, | ||
48 | @@ -195,6 +212,23 @@ | ||
49 | 5, | ||
50 | G_PARAM_READABLE)); | ||
51 | |||
52 | + gtk_widget_class_install_style_property (widget_class, | ||
53 | + g_param_spec_int ("extended_left_border", | ||
54 | + _("Content area extra left border"), | ||
55 | + _("Width of extra left border around the main dialog area"), | ||
56 | + 0, | ||
57 | + G_MAXINT, | ||
58 | + 0, | ||
59 | + G_PARAM_READABLE)); | ||
60 | + gtk_widget_class_install_style_property (widget_class, | ||
61 | + g_param_spec_int ("extended_right_border", | ||
62 | + _("Content area extra right border"), | ||
63 | + _("Width of extra right border around the main dialog area"), | ||
64 | + 0, | ||
65 | + G_MAXINT, | ||
66 | + 0, | ||
67 | + G_PARAM_READABLE)); | ||
68 | + | ||
69 | binding_set = gtk_binding_set_by_class (class); | ||
70 | |||
71 | gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, | ||
72 | @@ -205,9 +239,15 @@ | ||
73 | update_spacings (GtkDialog *dialog) | ||
74 | { | ||
75 | GtkWidget *widget; | ||
76 | + GtkWidget *hbox; | ||
77 | + GtkWidget *left_padding; | ||
78 | + GtkWidget *right_padding; | ||
79 | gint content_area_border; | ||
80 | gint button_spacing; | ||
81 | gint action_area_border; | ||
82 | + | ||
83 | + gint extended_left_border; | ||
84 | + gint extended_right_border; | ||
85 | |||
86 | widget = GTK_WIDGET (dialog); | ||
87 | |||
88 | @@ -218,6 +258,10 @@ | ||
89 | &button_spacing, | ||
90 | "action_area_border", | ||
91 | &action_area_border, | ||
92 | + "extended_left_border", | ||
93 | + &extended_left_border, | ||
94 | + "extended_right_border", | ||
95 | + &extended_right_border, | ||
96 | NULL); | ||
97 | |||
98 | gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), | ||
99 | @@ -226,12 +270,36 @@ | ||
100 | button_spacing); | ||
101 | gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), | ||
102 | action_area_border); | ||
103 | + | ||
104 | + if ((extended_left_border == 0) && (extended_right_border == 0)) | ||
105 | + /* no extended borders, so we are done */ | ||
106 | + return; | ||
107 | + | ||
108 | + /* extended borders are in use, so reconstruct dialog */ | ||
109 | + hbox = gtk_hbox_new(FALSE, 0); | ||
110 | + left_padding = gtk_alignment_new(0.0, 0.0, 0.0, 0.0); | ||
111 | + right_padding = gtk_alignment_new(0.0, 0.0, 0.0, 0.0); | ||
112 | + gtk_widget_set_size_request(left_padding, extended_left_border, 0); | ||
113 | + gtk_widget_set_size_request(right_padding, extended_right_border, 0); | ||
114 | + | ||
115 | + gtk_widget_ref(dialog->vbox); | ||
116 | + gtk_container_remove(GTK_CONTAINER(dialog), dialog->vbox); | ||
117 | + gtk_container_add(GTK_CONTAINER(hbox), left_padding); | ||
118 | + gtk_container_add(GTK_CONTAINER(hbox), dialog->vbox); | ||
119 | + gtk_container_add(GTK_CONTAINER(hbox), right_padding); | ||
120 | + gtk_container_add(GTK_CONTAINER(dialog), hbox); | ||
121 | + gtk_widget_unref(dialog->vbox); | ||
122 | + | ||
123 | + gtk_widget_show(left_padding); | ||
124 | + gtk_widget_show(right_padding); | ||
125 | + gtk_widget_show(hbox); | ||
126 | } | ||
127 | |||
128 | static void | ||
129 | gtk_dialog_init (GtkDialog *dialog) | ||
130 | { | ||
131 | GtkDialogPrivate *priv; | ||
132 | + GtkWidget *alignment; | ||
133 | |||
134 | priv = GET_PRIVATE (dialog); | ||
135 | priv->ignore_separator = FALSE; | ||
136 | @@ -250,14 +318,23 @@ | ||
137 | gtk_container_add (GTK_CONTAINER (dialog), dialog->vbox); | ||
138 | gtk_widget_show (dialog->vbox); | ||
139 | |||
140 | + /* Hildon : Here we add an alignment widget to gtk because | ||
141 | + * we want that the dialog buttons are all centered. */ | ||
142 | + alignment = gtk_alignment_new (0.5, 0.5, 0, 0); | ||
143 | + gtk_box_pack_end (GTK_BOX (dialog->vbox), alignment, FALSE, TRUE, 0); | ||
144 | + | ||
145 | dialog->action_area = gtk_hbutton_box_new (); | ||
146 | |||
147 | gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog->action_area), | ||
148 | GTK_BUTTONBOX_END); | ||
149 | |||
150 | - gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area, | ||
151 | - FALSE, TRUE, 0); | ||
152 | + /* we need add-signal to allocate correct area for childs */ | ||
153 | + gtk_container_add (GTK_CONTAINER (alignment), dialog->action_area); | ||
154 | + /* gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area, | ||
155 | + FALSE, TRUE, 0); */ | ||
156 | + | ||
157 | gtk_widget_show (dialog->action_area); | ||
158 | + gtk_widget_show (alignment); | ||
159 | |||
160 | dialog->separator = gtk_hseparator_new (); | ||
161 | gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->separator, FALSE, TRUE, 0); | ||
162 | @@ -616,9 +693,15 @@ | ||
163 | else | ||
164 | g_warning ("Only 'activatable' widgets can be packed into the action area of a GtkDialog"); | ||
165 | |||
166 | + gtk_container_add(GTK_CONTAINER(dialog->action_area), child); | ||
167 | +/* | ||
168 | gtk_box_pack_end (GTK_BOX (dialog->action_area), | ||
169 | child, | ||
170 | FALSE, TRUE, 0); | ||
171 | +*/ | ||
172 | + | ||
173 | + g_signal_connect (child, "focus", | ||
174 | + (GCallback)gtk_dialog_handle_focus, (gpointer)dialog); | ||
175 | |||
176 | if (response_id == GTK_RESPONSE_HELP) | ||
177 | gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (dialog->action_area), child, TRUE); | ||
178 | @@ -637,7 +720,7 @@ | ||
179 | * you don't need it. | ||
180 | * | ||
181 | * Return value: the button widget that was added | ||
182 | - **/ | ||
183 | + **/ /*ROK*/ | ||
184 | GtkWidget* | ||
185 | gtk_dialog_add_button (GtkDialog *dialog, | ||
186 | const gchar *button_text, | ||
187 | @@ -653,7 +736,10 @@ | ||
188 | GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); | ||
189 | |||
190 | gtk_widget_show (button); | ||
191 | - | ||
192 | + | ||
193 | + g_signal_connect (button, "focus", | ||
194 | + (GCallback)gtk_dialog_handle_focus, | ||
195 | + (gpointer)dialog); | ||
196 | gtk_dialog_add_action_widget (dialog, | ||
197 | button, | ||
198 | response_id); | ||
199 | @@ -990,6 +1076,8 @@ | ||
200 | gulong unmap_handler; | ||
201 | gulong destroy_handler; | ||
202 | gulong delete_handler; | ||
203 | + GtkDialogPrivate *priv; | ||
204 | + GList *list = NULL; | ||
205 | |||
206 | g_return_val_if_fail (GTK_IS_DIALOG (dialog), -1); | ||
207 | |||
208 | @@ -1001,6 +1089,27 @@ | ||
209 | |||
210 | if (!GTK_WIDGET_VISIBLE (dialog)) | ||
211 | gtk_widget_show (GTK_WIDGET (dialog)); | ||
212 | + | ||
213 | + priv = GET_PRIVATE (dialog); | ||
214 | + list = gtk_container_get_children (GTK_CONTAINER (dialog->vbox)); | ||
215 | + priv->first = gtk_dialog_get_first_sensitive (list); | ||
216 | + priv->last = gtk_dialog_get_last_sensitive (list); | ||
217 | + | ||
218 | + if (priv->first) | ||
219 | + { | ||
220 | + g_signal_connect (priv->first, "focus", | ||
221 | + (GCallback)gtk_dialog_handle_focus, | ||
222 | + (gpointer)dialog); | ||
223 | + } | ||
224 | + | ||
225 | + if (priv->last) | ||
226 | + { | ||
227 | + g_signal_connect (priv->last, "focus", | ||
228 | + (GCallback)gtk_dialog_handle_focus, | ||
229 | + (gpointer)dialog); | ||
230 | + } | ||
231 | + | ||
232 | + g_list_free (list); | ||
233 | |||
234 | response_handler = | ||
235 | g_signal_connect (dialog, | ||
236 | @@ -1236,4 +1345,215 @@ | ||
237 | gtk_box_reorder_child (GTK_BOX (dialog->action_area), child, position); | ||
238 | } | ||
239 | } | ||
240 | +static gboolean | ||
241 | +gtk_dialog_handle_focus (GtkWidget *widget, | ||
242 | + GtkDirectionType dir, | ||
243 | + gpointer user_data) | ||
244 | + { | ||
245 | + GtkDialog *dialog = NULL; | ||
246 | + GList *list = NULL; | ||
247 | + GList *iter = NULL; | ||
248 | + gint i = 0; | ||
249 | + gint list_length = 0; | ||
250 | + gboolean ret_val = FALSE; | ||
251 | + GtkDialogPrivate *priv; | ||
252 | + | ||
253 | + dialog = GTK_DIALOG(user_data); | ||
254 | + list = gtk_container_get_children (GTK_CONTAINER( | ||
255 | + GTK_DIALOG(user_data)->action_area)); | ||
256 | + iter = list; | ||
257 | + priv = GET_PRIVATE (dialog); | ||
258 | + | ||
259 | + if (GTK_WIDGET_HAS_FOCUS (widget)) | ||
260 | + if (widget == priv->first) | ||
261 | + { | ||
262 | + if (dir == GTK_DIR_UP) | ||
263 | + { | ||
264 | + ret_val = gtk_dialog_move_to_next_active_button (g_list_last (list), | ||
265 | + FALSE); | ||
266 | + } | ||
267 | + else if (dir == GTK_DIR_DOWN && priv->first == priv->last) | ||
268 | + ret_val = gtk_dialog_move_to_next_active_button (list, TRUE); | ||
269 | + else if (dir == GTK_DIR_DOWN) | ||
270 | + { | ||
271 | + } | ||
272 | + } | ||
273 | + else if (widget == priv->last) | ||
274 | + { | ||
275 | + if (dir == GTK_DIR_DOWN) | ||
276 | + { | ||
277 | + ret_val = gtk_dialog_move_to_next_active_button (list, TRUE); | ||
278 | + } | ||
279 | + else if (dir == GTK_DIR_UP) | ||
280 | + { | ||
281 | + } | ||
282 | + } | ||
283 | + else | ||
284 | + { | ||
285 | + list_length = g_list_length(list); | ||
286 | + while (iter != NULL) | ||
287 | + { | ||
288 | + ++i; | ||
289 | + if (iter->data == widget) | ||
290 | + { | ||
291 | + switch (dir) { | ||
292 | + case GTK_DIR_UP: | ||
293 | + /* If in the first item -> the default works like it should */ | ||
294 | + | ||
295 | + if (i > 1) | ||
296 | + { | ||
297 | + /* If not in the first button, but in the first active | ||
298 | + * button, the default should do, else handle movement | ||
299 | + * by yourself | ||
300 | + */ | ||
301 | + ret_val = gtk_dialog_move_to_next_active_button ( | ||
302 | + g_list_previous (iter), | ||
303 | + FALSE); | ||
304 | + } | ||
305 | + else | ||
306 | + { | ||
307 | + /* gtk_widget_grab_focus (priv->last);*/ | ||
308 | + g_signal_emit_by_name (dialog, "move-focus", | ||
309 | + GTK_DIR_TAB_BACKWARD); | ||
310 | + ret_val = TRUE; | ||
311 | + } | ||
312 | + break; | ||
313 | + | ||
314 | + /* If in the last item:jump to top, else select previous button */ | ||
315 | + case GTK_DIR_DOWN: | ||
316 | + if (i < list_length) | ||
317 | + { | ||
318 | + ret_val = gtk_dialog_move_to_next_active_button ( | ||
319 | + g_list_next (iter), | ||
320 | + TRUE); | ||
321 | + if (!ret_val) | ||
322 | + { | ||
323 | + g_signal_emit_by_name (dialog, "move-focus", | ||
324 | + GTK_DIR_TAB_FORWARD); | ||
325 | + ret_val = TRUE; | ||
326 | + } | ||
327 | + } | ||
328 | + else | ||
329 | + { | ||
330 | + g_signal_emit_by_name (dialog, "move-focus", | ||
331 | + GTK_DIR_TAB_FORWARD); | ||
332 | + ret_val = TRUE; | ||
333 | + } | ||
334 | + break; | ||
335 | + | ||
336 | + case GTK_DIR_TAB_BACKWARD: | ||
337 | + case GTK_DIR_TAB_FORWARD: | ||
338 | + case GTK_DIR_LEFT: | ||
339 | + case GTK_DIR_RIGHT: | ||
340 | + default: | ||
341 | + break; | ||
342 | + } | ||
343 | + break; | ||
344 | + } | ||
345 | + iter = g_list_next(iter); | ||
346 | + } | ||
347 | + } | ||
348 | + | ||
349 | + g_list_free (list); | ||
350 | + | ||
351 | + return ret_val; | ||
352 | + } | ||
353 | +static gboolean | ||
354 | +gtk_dialog_move_to_next_active_button (GList *iter, gboolean forward) | ||
355 | +{ | ||
356 | + gboolean active; | ||
357 | + gboolean visible; | ||
358 | + | ||
359 | + while (iter) | ||
360 | + { | ||
361 | + g_object_get (G_OBJECT (iter->data), "sensitive", &active, NULL); | ||
362 | + g_object_get (G_OBJECT (iter->data), "visible", &visible, NULL); | ||
363 | + if (active && visible) | ||
364 | + { | ||
365 | + gtk_widget_grab_focus (GTK_WIDGET (iter->data)); | ||
366 | + return TRUE; | ||
367 | + } | ||
368 | + | ||
369 | + if (forward) | ||
370 | + iter = g_list_next (iter); | ||
371 | + else | ||
372 | + iter = g_list_previous (iter); | ||
373 | + } | ||
374 | + | ||
375 | + return FALSE; | ||
376 | +} | ||
377 | +static GtkWidget* | ||
378 | +gtk_dialog_get_first_sensitive (GList *list) | ||
379 | +{ | ||
380 | + GList *sublist = NULL; | ||
381 | + GList *iter = NULL; | ||
382 | + GtkWidget *widget = NULL; | ||
383 | + gboolean active; | ||
384 | + gboolean visible; | ||
385 | + while (list) | ||
386 | + { | ||
387 | + widget = GTK_WIDGET (list->data); | ||
388 | + if (GTK_IS_CONTAINER (widget)) | ||
389 | + { | ||
390 | + sublist = gtk_container_get_children (GTK_CONTAINER(widget)); | ||
391 | + widget = gtk_dialog_get_first_sensitive (sublist); | ||
392 | + g_list_free (sublist); | ||
393 | + sublist = NULL; | ||
394 | + | ||
395 | + if (widget) | ||
396 | + return widget; | ||
397 | + } | ||
398 | + else | ||
399 | + { | ||
400 | + g_object_get (G_OBJECT (widget), "sensitive", &active, NULL); | ||
401 | + g_object_get (G_OBJECT (widget), "visible", &visible, NULL); | ||
402 | + if (active && visible && GTK_WIDGET_CAN_FOCUS (widget)) | ||
403 | + return widget; | ||
404 | + } | ||
405 | + | ||
406 | + list = g_list_next (list); | ||
407 | + } | ||
408 | + | ||
409 | + return NULL; | ||
410 | +} | ||
411 | + | ||
412 | +static GtkWidget* | ||
413 | +gtk_dialog_get_last_sensitive (GList *list) | ||
414 | +{ | ||
415 | + GList *sublist = NULL; | ||
416 | + GtkWidget *widget = NULL; | ||
417 | + gboolean active; | ||
418 | + gboolean visible; | ||
419 | + | ||
420 | + list = g_list_last (list); | ||
421 | + if (list && list->prev != NULL) | ||
422 | + list = g_list_previous (list); | ||
423 | + | ||
424 | + while (list) | ||
425 | + { | ||
426 | + widget = GTK_WIDGET (list->data); | ||
427 | + if (GTK_IS_CONTAINER (widget)) | ||
428 | + { | ||
429 | + sublist = gtk_container_get_children (GTK_CONTAINER(widget)); | ||
430 | + widget = gtk_dialog_get_last_sensitive (sublist); | ||
431 | + g_list_free (sublist); | ||
432 | + sublist = NULL; | ||
433 | + | ||
434 | + if (widget) | ||
435 | + return widget; | ||
436 | + } | ||
437 | + else | ||
438 | + { | ||
439 | + g_object_get (G_OBJECT (widget), "sensitive", &active, NULL); | ||
440 | + g_object_get (G_OBJECT (widget), "visible", &visible, NULL); | ||
441 | + if (active && visible && GTK_WIDGET_CAN_FOCUS (widget)) | ||
442 | + return widget; | ||
443 | + } | ||
444 | + | ||
445 | + list = g_list_previous (list); | ||
446 | + } | ||
447 | + | ||
448 | + return NULL; | ||
449 | +} | ||
450 | + | ||
451 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkdnd.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkdnd.c.diff deleted file mode 100644 index 247d3f9b46..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkdnd.c.diff +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkdnd.c 2005-02-01 20:07:40.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkdnd.c 2005-04-06 16:19:36.432999704 +0300 | ||
3 | @@ -2145,6 +2145,9 @@ | ||
4 | g_signal_connect (widget, "button_press_event", | ||
5 | G_CALLBACK (gtk_drag_source_event_cb), | ||
6 | site); | ||
7 | + g_signal_connect (widget, "button_release_event", | ||
8 | + G_CALLBACK (gtk_drag_source_event_cb), | ||
9 | + site); | ||
10 | g_signal_connect (widget, "motion_notify_event", | ||
11 | G_CALLBACK (gtk_drag_source_event_cb), | ||
12 | site); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkentry.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkentry.c.diff deleted file mode 100644 index fae911305c..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkentry.c.diff +++ /dev/null | |||
@@ -1,1308 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkentry.c 2005-02-04 17:36:02.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkentry.c 2005-04-06 16:19:36.466994536 +0300 | ||
3 | @@ -24,6 +24,10 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | + /* Modified for Nokia Oyj during 2002-2003. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | #include <config.h> | ||
12 | #include <string.h> | ||
13 | |||
14 | @@ -53,6 +57,7 @@ | ||
15 | #include "gtktreeselection.h" | ||
16 | #include "gtkentryprivate.h" | ||
17 | #include "gtkcelllayout.h" | ||
18 | +#include "gtkscrolledwindow.h" | ||
19 | |||
20 | #define GTK_ENTRY_COMPLETION_KEY "gtk-entry-completion-key" | ||
21 | |||
22 | @@ -60,6 +65,8 @@ | ||
23 | #define DRAW_TIMEOUT 20 | ||
24 | #define INNER_BORDER 2 | ||
25 | #define COMPLETION_TIMEOUT 300 | ||
26 | +#define HILDON_EDITED_CHARACTER_MAX 8 | ||
27 | +#define HILDON_EDITED_CHARACTER_MS 600 /* 0.6 seconds */ | ||
28 | |||
29 | /* Initial size of buffer, in bytes */ | ||
30 | #define MIN_SIZE 16 | ||
31 | @@ -75,6 +82,18 @@ | ||
32 | { | ||
33 | gfloat xalign; | ||
34 | gint insert_pos; | ||
35 | + /* Hildon additions: | ||
36 | + * following variables are needed | ||
37 | + * for Hildon password 'preview' | ||
38 | + * functionality; last inputted character | ||
39 | + * is showed for defined period, before it is | ||
40 | + * rendered to '*' | ||
41 | + */ | ||
42 | + gchar hildon_edited_character[HILDON_EDITED_CHARACTER_MAX]; | ||
43 | + gboolean hildon_edited_character_timeout; | ||
44 | + gint hildon_edited_character_length; | ||
45 | + gboolean keep_focus; | ||
46 | + gboolean menu_popped; | ||
47 | }; | ||
48 | |||
49 | enum { | ||
50 | @@ -104,7 +123,9 @@ | ||
51 | PROP_WIDTH_CHARS, | ||
52 | PROP_SCROLL_OFFSET, | ||
53 | PROP_TEXT, | ||
54 | - PROP_XALIGN | ||
55 | + PROP_XALIGN, | ||
56 | + PROP_AUTOCAP, | ||
57 | + PROP_INPUT_MODE | ||
58 | }; | ||
59 | |||
60 | static guint signals[LAST_SIGNAL] = { 0 }; | ||
61 | @@ -324,6 +345,23 @@ | ||
62 | gint *y, | ||
63 | gint *width, | ||
64 | gint *height); | ||
65 | +static void gtk_entry_update_scrolled_window (GtkEntry *entry); | ||
66 | +static void gtk_entry_set_autocap (GtkEntry *entry, | ||
67 | + gboolean autocap); | ||
68 | +static gboolean gtk_entry_get_autocap (GtkEntry *entry); | ||
69 | +static void gtk_entry_set_input_mode (GtkEntry *entry, | ||
70 | + gboolean mode); | ||
71 | +static gint gtk_entry_get_input_mode (GtkEntry *entry); | ||
72 | + | ||
73 | +/*Change for Hildon | ||
74 | + *returns an iterator to the character at position x,y of the | ||
75 | + *layout | ||
76 | + *returns NULL if no iterator was found at that position | ||
77 | + *Caller must call pango_layout_free_iter on the returned iterator | ||
78 | + */ | ||
79 | +static PangoLayoutIter *get_char_at_pos( PangoLayout *layout, gint x, gint y ); | ||
80 | + | ||
81 | +static gboolean hildon_remove_visible_character( gpointer data ); | ||
82 | |||
83 | /* Completion */ | ||
84 | static gint gtk_entry_completion_timeout (gpointer data); | ||
85 | @@ -523,7 +561,25 @@ | ||
86 | P_("FALSE displays the \"invisible char\" instead of the actual text (password mode)"), | ||
87 | TRUE, | ||
88 | G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
89 | - | ||
90 | + | ||
91 | + g_object_class_install_property (gobject_class, | ||
92 | + PROP_AUTOCAP, | ||
93 | + g_param_spec_boolean ("autocap", | ||
94 | + P_("auto capitalization"), | ||
95 | + P_("Enable autocap support"), | ||
96 | + TRUE, | ||
97 | + G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
98 | + | ||
99 | + g_object_class_install_property (gobject_class, | ||
100 | + PROP_INPUT_MODE, | ||
101 | + g_param_spec_int ("input_mode", | ||
102 | + P_("input mode"), | ||
103 | + P_("Define widget's input mode"), | ||
104 | + 0, | ||
105 | + 9, /* keep me updated */ | ||
106 | + 0, | ||
107 | + G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
108 | + | ||
109 | g_object_class_install_property (gobject_class, | ||
110 | PROP_HAS_FRAME, | ||
111 | g_param_spec_boolean ("has_frame", | ||
112 | @@ -593,6 +649,40 @@ | ||
113 | 0.0, | ||
114 | G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
115 | |||
116 | + gtk_widget_class_install_style_property (widget_class, | ||
117 | + g_param_spec_int ("horizontal-border", | ||
118 | + P_("Horizontal borders for entry"), | ||
119 | + P_("Set left/right borders"), | ||
120 | + 0, | ||
121 | + G_MAXINT, | ||
122 | + INNER_BORDER, | ||
123 | + G_PARAM_READWRITE)); | ||
124 | + | ||
125 | + gtk_widget_class_install_style_property (widget_class, | ||
126 | + g_param_spec_int ("vertical-border", | ||
127 | + P_("Vertical borders for entry"), | ||
128 | + P_("Set top/bottom borders"), | ||
129 | + 0, | ||
130 | + G_MAXINT, | ||
131 | + INNER_BORDER, | ||
132 | + G_PARAM_READWRITE)); | ||
133 | + | ||
134 | + gtk_widget_class_install_style_property (widget_class, | ||
135 | + g_param_spec_int ("icon-width", | ||
136 | + P_("Icon Width"), | ||
137 | + P_("Size of the purpose icon."), | ||
138 | + 0, | ||
139 | + G_MAXINT, | ||
140 | + 0, | ||
141 | + G_PARAM_READWRITE)); | ||
142 | + | ||
143 | + gtk_widget_class_install_style_property (widget_class, | ||
144 | + g_param_spec_boolean ("show-last-char", | ||
145 | + P_("Show last char in invisible mode for a while"), | ||
146 | + P_("Last char is shown before it is rendered to asterisk"), | ||
147 | + FALSE, | ||
148 | + G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
149 | + | ||
150 | signals[POPULATE_POPUP] = | ||
151 | g_signal_new ("populate_popup", | ||
152 | G_OBJECT_CLASS_TYPE (gobject_class), | ||
153 | @@ -853,6 +943,22 @@ | ||
154 | iface->start_editing = gtk_entry_start_editing; | ||
155 | } | ||
156 | |||
157 | +/* HILDON: Timed function to hide the most recently inputted character in password mode | ||
158 | +*/ | ||
159 | +static gboolean | ||
160 | + hildon_remove_visible_character( gpointer data ) | ||
161 | +{ | ||
162 | + g_return_val_if_fail (GTK_IS_WIDGET (data), FALSE); | ||
163 | + | ||
164 | + GtkEntry * entry = GTK_ENTRY( data ); | ||
165 | + | ||
166 | + /* Force the string to redrawn, but now without a visible character */ | ||
167 | + gtk_entry_recompute( entry ); | ||
168 | + | ||
169 | + /* Return false so this timeout is not called again and destroyed */ | ||
170 | + return FALSE; | ||
171 | +} | ||
172 | + | ||
173 | static void | ||
174 | gtk_entry_set_property (GObject *object, | ||
175 | guint prop_id, | ||
176 | @@ -867,9 +973,10 @@ | ||
177 | { | ||
178 | gboolean new_value = g_value_get_boolean (value); | ||
179 | |||
180 | + gtk_widget_set_sensitive( GTK_WIDGET( entry ), entry->editable ); | ||
181 | if (new_value != entry->editable) | ||
182 | { | ||
183 | - if (!new_value) | ||
184 | + if (!new_value) | ||
185 | { | ||
186 | gtk_entry_reset_im_context (entry); | ||
187 | if (GTK_WIDGET_HAS_FOCUS (entry)) | ||
188 | @@ -896,6 +1003,14 @@ | ||
189 | case PROP_VISIBILITY: | ||
190 | gtk_entry_set_visibility (entry, g_value_get_boolean (value)); | ||
191 | break; | ||
192 | + | ||
193 | + case PROP_AUTOCAP: | ||
194 | + gtk_entry_set_autocap (entry, g_value_get_boolean (value)); | ||
195 | + break; | ||
196 | + | ||
197 | + case PROP_INPUT_MODE: | ||
198 | + gtk_entry_set_input_mode (entry, g_value_get_int (value)); | ||
199 | + break; | ||
200 | |||
201 | case PROP_HAS_FRAME: | ||
202 | gtk_entry_set_has_frame (entry, g_value_get_boolean (value)); | ||
203 | @@ -954,6 +1069,12 @@ | ||
204 | case PROP_VISIBILITY: | ||
205 | g_value_set_boolean (value, entry->visible); | ||
206 | break; | ||
207 | + case PROP_AUTOCAP: | ||
208 | + g_value_set_boolean (value, gtk_entry_get_autocap (entry)); | ||
209 | + break; | ||
210 | + case PROP_INPUT_MODE: | ||
211 | + g_value_set_int (value, gtk_entry_get_input_mode (entry)); | ||
212 | + break; | ||
213 | case PROP_HAS_FRAME: | ||
214 | g_value_set_boolean (value, entry->has_frame); | ||
215 | break; | ||
216 | @@ -1000,7 +1121,20 @@ | ||
217 | entry->width_chars = -1; | ||
218 | entry->is_cell_renderer = FALSE; | ||
219 | entry->editing_canceled = FALSE; | ||
220 | - entry->has_frame = TRUE; | ||
221 | +#ifdef HILDON_SINGLE_LINE_EDITOR | ||
222 | + entry->has_frame = FALSE; | ||
223 | +#else | ||
224 | + entry->has_frame = TRUE; | ||
225 | +#endif | ||
226 | + | ||
227 | + /* Hildon */ | ||
228 | + memset( &priv->hildon_edited_character, 0x00, HILDON_EDITED_CHARACTER_MAX ); | ||
229 | + priv->hildon_edited_character_length = 0; | ||
230 | + priv->hildon_edited_character_timeout = FALSE; | ||
231 | + | ||
232 | + priv->keep_focus = FALSE; | ||
233 | + priv->menu_popped = FALSE; | ||
234 | + | ||
235 | priv->xalign = 0.0; | ||
236 | |||
237 | gtk_drag_dest_set (GTK_WIDGET (entry), | ||
238 | @@ -1013,6 +1147,10 @@ | ||
239 | * to it; so we create it here and destroy it in finalize(). | ||
240 | */ | ||
241 | entry->im_context = gtk_im_multicontext_new (); | ||
242 | + /* Set default stuff. */ | ||
243 | + gtk_entry_set_autocap (entry, TRUE); | ||
244 | + gtk_entry_set_input_mode (entry, 0); /* alpha-numeric-special */ | ||
245 | + g_object_set (G_OBJECT (entry->im_context), "use-show-hide", TRUE, NULL); | ||
246 | |||
247 | g_signal_connect (entry->im_context, "commit", | ||
248 | G_CALLBACK (gtk_entry_commit_cb), entry); | ||
249 | @@ -1058,7 +1196,8 @@ | ||
250 | gtk_entry_finalize (GObject *object) | ||
251 | { | ||
252 | GtkEntry *entry = GTK_ENTRY (object); | ||
253 | - | ||
254 | + GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (GTK_WIDGET (entry)); | ||
255 | + | ||
256 | gtk_entry_set_completion (entry, NULL); | ||
257 | |||
258 | if (entry->cached_layout) | ||
259 | @@ -1072,6 +1211,9 @@ | ||
260 | if (entry->recompute_idle) | ||
261 | g_source_remove (entry->recompute_idle); | ||
262 | |||
263 | + if (priv->hildon_edited_character_timeout) | ||
264 | + g_source_remove (priv->hildon_edited_character_timeout); | ||
265 | + | ||
266 | entry->text_size = 0; | ||
267 | |||
268 | if (entry->text) | ||
269 | @@ -1213,7 +1355,14 @@ | ||
270 | PangoFontMetrics *metrics; | ||
271 | gint xborder, yborder; | ||
272 | PangoContext *context; | ||
273 | - | ||
274 | + gint border_x, border_y; | ||
275 | + gint icon_width; | ||
276 | + | ||
277 | + gtk_widget_style_get (widget, | ||
278 | + "horizontal-border", &border_x, | ||
279 | + "vertical-border", &border_y, | ||
280 | + "icon-width", &icon_width, NULL); | ||
281 | + | ||
282 | gtk_widget_ensure_style (widget); | ||
283 | context = gtk_widget_get_pango_context (widget); | ||
284 | metrics = pango_context_get_metrics (context, | ||
285 | @@ -1225,21 +1374,22 @@ | ||
286 | |||
287 | _gtk_entry_get_borders (entry, &xborder, &yborder); | ||
288 | |||
289 | - xborder += INNER_BORDER; | ||
290 | - yborder += INNER_BORDER; | ||
291 | + xborder += border_x<<1; | ||
292 | + yborder += border_y<<1; | ||
293 | |||
294 | if (entry->width_chars < 0) | ||
295 | - requisition->width = MIN_ENTRY_WIDTH + xborder * 2; | ||
296 | + requisition->width = MIN_ENTRY_WIDTH + xborder; | ||
297 | else | ||
298 | { | ||
299 | gint char_width = pango_font_metrics_get_approximate_char_width (metrics); | ||
300 | gint digit_width = pango_font_metrics_get_approximate_digit_width (metrics); | ||
301 | gint char_pixels = (MAX (char_width, digit_width) + PANGO_SCALE - 1) / PANGO_SCALE; | ||
302 | |||
303 | - requisition->width = char_pixels * entry->width_chars + xborder * 2; | ||
304 | + requisition->width = char_pixels * entry->width_chars + xborder; | ||
305 | } | ||
306 | - | ||
307 | - requisition->height = PANGO_PIXELS (entry->ascent + entry->descent) + yborder * 2; | ||
308 | + | ||
309 | + requisition->width += icon_width; | ||
310 | + requisition->height = PANGO_PIXELS (entry->ascent + entry->descent) + yborder; | ||
311 | |||
312 | pango_font_metrics_unref (metrics); | ||
313 | } | ||
314 | @@ -1253,23 +1403,39 @@ | ||
315 | { | ||
316 | gint xborder, yborder; | ||
317 | GtkRequisition requisition; | ||
318 | + gint icon_width; | ||
319 | GtkWidget *widget = GTK_WIDGET (entry); | ||
320 | |||
321 | + gtk_widget_style_get (widget, "icon-width", &icon_width, NULL); | ||
322 | + | ||
323 | gtk_widget_get_child_requisition (widget, &requisition); | ||
324 | |||
325 | _gtk_entry_get_borders (entry, &xborder, &yborder); | ||
326 | |||
327 | if (x) | ||
328 | - *x = xborder; | ||
329 | + *x = xborder + icon_width; | ||
330 | |||
331 | if (y) | ||
332 | + { | ||
333 | *y = yborder; | ||
334 | + if( widget->allocation.height < requisition.height ) | ||
335 | + *y += ((widget->allocation.height - requisition.height) / 2); | ||
336 | + if( *y < yborder ) | ||
337 | + *y = yborder; | ||
338 | + } | ||
339 | |||
340 | if (width) | ||
341 | - *width = GTK_WIDGET (entry)->allocation.width - xborder * 2; | ||
342 | + *width = GTK_WIDGET (entry)->allocation.width - xborder * 2 - icon_width; | ||
343 | |||
344 | if (height) | ||
345 | - *height = requisition.height - yborder * 2; | ||
346 | + { | ||
347 | + if( widget->allocation.height < requisition.height ) | ||
348 | + *height = widget->allocation.height - yborder * 2; | ||
349 | + else | ||
350 | + *height = widget->requisition.height - yborder * 2; | ||
351 | + if( *height <=0 ) | ||
352 | + *height = 1; | ||
353 | + } | ||
354 | } | ||
355 | |||
356 | static void | ||
357 | @@ -1289,10 +1455,9 @@ | ||
358 | |||
359 | if (y) | ||
360 | { | ||
361 | - if (entry->is_cell_renderer) | ||
362 | - *y = widget->allocation.y; | ||
363 | - else | ||
364 | - *y = widget->allocation.y + (widget->allocation.height - requisition.height) / 2; | ||
365 | + *y = widget->allocation.y; | ||
366 | + if( widget->allocation.height > requisition.height ) | ||
367 | + *y += ((widget->allocation.height - requisition.height) / 2); | ||
368 | } | ||
369 | |||
370 | if (width) | ||
371 | @@ -1300,10 +1465,10 @@ | ||
372 | |||
373 | if (height) | ||
374 | { | ||
375 | - if (entry->is_cell_renderer) | ||
376 | - *height = widget->allocation.height; | ||
377 | - else | ||
378 | + if( widget->allocation.height > requisition.height ) | ||
379 | *height = requisition.height; | ||
380 | + else | ||
381 | + *height = widget->allocation.height; | ||
382 | } | ||
383 | } | ||
384 | |||
385 | @@ -1383,20 +1548,19 @@ | ||
386 | GdkEventExpose *event) | ||
387 | { | ||
388 | GtkEntry *entry = GTK_ENTRY (widget); | ||
389 | + gint area_width, area_height; | ||
390 | + | ||
391 | + get_widget_window_size (entry, NULL, NULL, &area_width, &area_height); | ||
392 | |||
393 | if (widget->window == event->window) | ||
394 | - gtk_entry_draw_frame (widget); | ||
395 | + { | ||
396 | + gtk_paint_box (widget->style, widget->window, | ||
397 | + GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE, | ||
398 | + NULL, widget, "entry_frame", | ||
399 | + 0, 0, area_width, area_height); | ||
400 | + } | ||
401 | else if (entry->text_area == event->window) | ||
402 | { | ||
403 | - gint area_width, area_height; | ||
404 | - | ||
405 | - get_text_area_size (entry, NULL, NULL, &area_width, &area_height); | ||
406 | - | ||
407 | - gtk_paint_flat_box (widget->style, entry->text_area, | ||
408 | - GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE, | ||
409 | - NULL, widget, "entry_bg", | ||
410 | - 0, 0, area_width, area_height); | ||
411 | - | ||
412 | if ((entry->visible || entry->invisible_char != 0) && | ||
413 | GTK_WIDGET_HAS_FOCUS (widget) && | ||
414 | entry->selection_bound == entry->current_pos && entry->cursor_visible) | ||
415 | @@ -1490,16 +1654,19 @@ | ||
416 | return FALSE; | ||
417 | |||
418 | entry->button = event->button; | ||
419 | - | ||
420 | + | ||
421 | if (!GTK_WIDGET_HAS_FOCUS (widget)) | ||
422 | { | ||
423 | entry->in_click = TRUE; | ||
424 | gtk_widget_grab_focus (widget); | ||
425 | entry->in_click = FALSE; | ||
426 | } | ||
427 | - | ||
428 | + | ||
429 | + /* Hildon: we need to reset IM context so pre-edit string can be committed */ | ||
430 | + gtk_entry_reset_im_context (entry); | ||
431 | + | ||
432 | tmp_pos = gtk_entry_find_position (entry, event->x + entry->scroll_offset); | ||
433 | - | ||
434 | + | ||
435 | if (event->button == 1) | ||
436 | { | ||
437 | gboolean have_selection = gtk_editable_get_selection_bounds (editable, &sel_start, &sel_end); | ||
438 | @@ -1509,8 +1676,6 @@ | ||
439 | |||
440 | if (event->state & GDK_SHIFT_MASK) | ||
441 | { | ||
442 | - gtk_entry_reset_im_context (entry); | ||
443 | - | ||
444 | if (!have_selection) /* select from the current position to the clicked position */ | ||
445 | sel_start = sel_end = entry->current_pos; | ||
446 | |||
447 | @@ -1575,9 +1740,20 @@ | ||
448 | entry->drag_start_x = event->x + entry->scroll_offset; | ||
449 | entry->drag_start_y = event->y + entry->scroll_offset; | ||
450 | } | ||
451 | - else | ||
452 | - gtk_editable_set_position (editable, tmp_pos); | ||
453 | - break; | ||
454 | + else { | ||
455 | + /* HILDON: do not move the cursor inside the textarea if invisible | ||
456 | + * as per the specifications */ | ||
457 | + if (!entry->visible) | ||
458 | + if(tmp_pos == strlen(gtk_entry_get_text(entry))){ | ||
459 | + gtk_editable_set_position( editable, entry->text_length); | ||
460 | + } else { | ||
461 | + gtk_editable_select_region (editable, 0, -1); | ||
462 | + } | ||
463 | + else | ||
464 | + gtk_editable_set_position (editable, tmp_pos); | ||
465 | + } | ||
466 | + | ||
467 | + break; | ||
468 | |||
469 | case GDK_2BUTTON_PRESS: | ||
470 | /* We ALWAYS receive a GDK_BUTTON_PRESS immediately before | ||
471 | @@ -1614,8 +1790,16 @@ | ||
472 | } | ||
473 | else if (event->button == 3 && event->type == GDK_BUTTON_PRESS) | ||
474 | { | ||
475 | + /* Hildon: if we are in password mode selection and Cut & Copy should | ||
476 | + be disabled. */ | ||
477 | + if (!entry->visible) | ||
478 | + { | ||
479 | + gtk_editable_set_position (GTK_EDITABLE(entry), 0); | ||
480 | + } | ||
481 | + | ||
482 | gtk_entry_do_popup (entry, event); | ||
483 | entry->button = 0; /* Don't wait for release, since the menu will gtk_grab_add */ | ||
484 | + priv->keep_focus = TRUE; | ||
485 | |||
486 | return TRUE; | ||
487 | } | ||
488 | @@ -1632,11 +1816,23 @@ | ||
489 | if (event->window != entry->text_area || entry->button != event->button) | ||
490 | return FALSE; | ||
491 | |||
492 | + if (entry->editable) | ||
493 | + gtk_im_context_show (entry->im_context); | ||
494 | + | ||
495 | if (entry->in_drag) | ||
496 | { | ||
497 | gint tmp_pos = gtk_entry_find_position (entry, entry->drag_start_x); | ||
498 | |||
499 | - gtk_editable_set_position (GTK_EDITABLE (entry), tmp_pos); | ||
500 | + /* HILDON: If not visible, do not allow cursor to be positioned inside the string */ | ||
501 | + if (!entry->visible){ | ||
502 | + if(tmp_pos == strlen(gtk_entry_get_text(entry))){ | ||
503 | + gtk_editable_set_position( GTK_EDITABLE(entry), entry->text_length); | ||
504 | + } else { | ||
505 | + gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1); | ||
506 | + } | ||
507 | + } else { | ||
508 | + gtk_editable_set_position (GTK_EDITABLE (entry), tmp_pos); | ||
509 | + } | ||
510 | |||
511 | entry->in_drag = 0; | ||
512 | } | ||
513 | @@ -1822,6 +2018,13 @@ | ||
514 | } | ||
515 | } | ||
516 | |||
517 | + if (event->keyval == GDK_Return) | ||
518 | + return FALSE; | ||
519 | + if (event->keyval == GDK_KP_Enter) | ||
520 | + g_signal_emit_by_name (G_OBJECT(gtk_widget_get_ancestor (widget, | ||
521 | + GTK_TYPE_WINDOW)), "move-focus", | ||
522 | + GTK_DIR_TAB_FORWARD); | ||
523 | + | ||
524 | if (GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event)) | ||
525 | /* Activate key bindings | ||
526 | */ | ||
527 | @@ -1835,6 +2038,8 @@ | ||
528 | GdkEventKey *event) | ||
529 | { | ||
530 | GtkEntry *entry = GTK_ENTRY (widget); | ||
531 | + | ||
532 | + gtk_entry_update_scrolled_window( entry ); | ||
533 | |||
534 | if (entry->editable) | ||
535 | { | ||
536 | @@ -1853,7 +2058,35 @@ | ||
537 | GdkEventFocus *event) | ||
538 | { | ||
539 | GtkEntry *entry = GTK_ENTRY (widget); | ||
540 | - | ||
541 | + GtkEntryPrivate *priv; | ||
542 | + | ||
543 | + priv = GTK_ENTRY_GET_PRIVATE (widget); | ||
544 | + /* Hildon : If the text doesn't fit the entry, upon focusing | ||
545 | + * to an text field, move the caret to the end of the entry. | ||
546 | + * Force the entry to recompute, otherwise it doesn't update | ||
547 | + * if the cursor is currently at the end*/ | ||
548 | + /* hildon : If the text has no selection and focus returned with | ||
549 | + other means than pointer click, set cursor before first | ||
550 | + character of the text, otherwise behave normally */ | ||
551 | + | ||
552 | + if (!entry->in_click) | ||
553 | + { | ||
554 | + /*gboolean has_selection; | ||
555 | + has_selection = gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), NULL, NULL); | ||
556 | + if (!has_selection) | ||
557 | + { | ||
558 | + gtk_editable_set_position (GTK_EDITABLE (entry), -1); | ||
559 | + }*//*FIXME need a better hack here*/ | ||
560 | + /* Hildon: If in SecretEditor mode highlight selection if entry got focus | ||
561 | + * otherways than mouse/stylus */ | ||
562 | + if (!entry->visible && priv->keep_focus) | ||
563 | + { | ||
564 | + gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1); | ||
565 | + } | ||
566 | + } | ||
567 | + | ||
568 | + gtk_entry_recompute (GTK_ENTRY (entry)); | ||
569 | + | ||
570 | gtk_widget_queue_draw (widget); | ||
571 | |||
572 | if (entry->editable) | ||
573 | @@ -1876,6 +2109,8 @@ | ||
574 | GdkEventFocus *event) | ||
575 | { | ||
576 | GtkEntry *entry = GTK_ENTRY (widget); | ||
577 | + GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (widget); | ||
578 | + guint tmp_pos; | ||
579 | GtkEntryCompletion *completion; | ||
580 | |||
581 | gtk_widget_queue_draw (widget); | ||
582 | @@ -1886,6 +2121,20 @@ | ||
583 | gtk_im_context_focus_out (entry->im_context); | ||
584 | } | ||
585 | |||
586 | + tmp_pos = gtk_editable_get_position (GTK_EDITABLE (widget)); | ||
587 | + if (priv->keep_focus){ | ||
588 | + if (!entry->visible) | ||
589 | + gtk_editable_set_position (GTK_EDITABLE (widget), tmp_pos); | ||
590 | + priv->keep_focus = FALSE; | ||
591 | + } | ||
592 | + else { | ||
593 | + if (priv->menu_popped) | ||
594 | + priv->menu_popped = FALSE; | ||
595 | + else gtk_editable_set_position (GTK_EDITABLE (widget), tmp_pos); | ||
596 | + } | ||
597 | + | ||
598 | + gtk_widget_queue_draw(widget); | ||
599 | + | ||
600 | gtk_entry_check_cursor_blink (entry); | ||
601 | |||
602 | g_signal_handlers_disconnect_by_func (gdk_keymap_get_for_display (gtk_widget_get_display (widget)), | ||
603 | @@ -1902,7 +2151,6 @@ | ||
604 | static void | ||
605 | gtk_entry_grab_focus (GtkWidget *widget) | ||
606 | { | ||
607 | - GtkEntry *entry = GTK_ENTRY (widget); | ||
608 | gboolean select_on_focus; | ||
609 | |||
610 | GTK_WIDGET_CLASS (parent_class)->grab_focus (widget); | ||
611 | @@ -1912,8 +2160,8 @@ | ||
612 | &select_on_focus, | ||
613 | NULL); | ||
614 | |||
615 | - if (select_on_focus && entry->editable && !entry->in_click) | ||
616 | - gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1); | ||
617 | +/* Hildon : When focusing to an entry, it shouldn't become | ||
618 | + * highlighted. */ | ||
619 | } | ||
620 | |||
621 | static void | ||
622 | @@ -1987,7 +2235,7 @@ | ||
623 | |||
624 | if (new_text_length > 63) | ||
625 | g_free (text); | ||
626 | - | ||
627 | + gtk_entry_update_scrolled_window( entry ); | ||
628 | g_object_unref (editable); | ||
629 | } | ||
630 | |||
631 | @@ -2074,7 +2322,7 @@ | ||
632 | if (end < 0) | ||
633 | end = entry->text_length; | ||
634 | |||
635 | - gtk_entry_reset_im_context (entry); | ||
636 | + /*gtk_entry_reset_im_context (entry);*//*FIXME tmp kludge, might break something*/ | ||
637 | |||
638 | gtk_entry_set_positions (entry, | ||
639 | MIN (end, entry->text_length), | ||
640 | @@ -2168,13 +2416,19 @@ | ||
641 | { | ||
642 | gint index; | ||
643 | gint n_chars; | ||
644 | + gboolean show_last_char = FALSE; | ||
645 | |||
646 | GtkEntry *entry = GTK_ENTRY (editable); | ||
647 | - | ||
648 | + GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (GTK_WIDGET (entry)); | ||
649 | if (new_text_length < 0) | ||
650 | new_text_length = strlen (new_text); | ||
651 | |||
652 | n_chars = g_utf8_strlen (new_text, new_text_length); | ||
653 | + | ||
654 | + | ||
655 | + gtk_widget_style_get (GTK_WIDGET (entry), "show-last-char", | ||
656 | + &show_last_char, NULL); | ||
657 | + | ||
658 | if (entry->text_max_length > 0 && n_chars + entry->text_length > entry->text_max_length) | ||
659 | { | ||
660 | gdk_display_beep (gtk_widget_get_display (GTK_WIDGET (entry))); | ||
661 | @@ -2238,6 +2492,14 @@ | ||
662 | |||
663 | if (entry->selection_bound > *position) | ||
664 | entry->selection_bound += n_chars; | ||
665 | + | ||
666 | + /* Hildon: store this addition IF it was only 1 char (user inputted) and we are currently in secret mode (invisible) */ | ||
667 | + | ||
668 | + if (show_last_char && n_chars == 1 && !entry->visible && (new_text_length < HILDON_EDITED_CHARACTER_MAX)) { | ||
669 | + memset( &priv->hildon_edited_character, 0x00, HILDON_EDITED_CHARACTER_MAX ); | ||
670 | + priv->hildon_edited_character_length = new_text_length; | ||
671 | + memcpy( &priv->hildon_edited_character, new_text, new_text_length ); /* Guaranteed to be < total length */ | ||
672 | + } | ||
673 | |||
674 | *position += n_chars; | ||
675 | |||
676 | @@ -2339,6 +2601,11 @@ | ||
677 | |||
678 | gtk_entry_reset_im_context (entry); | ||
679 | |||
680 | + /* Hildon, if not visible set the position to the end */ | ||
681 | + /* New SecretEditor specs say that with cursor should move | ||
682 | + * With left/right arrows | ||
683 | + */ | ||
684 | + | ||
685 | if (entry->current_pos != entry->selection_bound && !extend_selection) | ||
686 | { | ||
687 | /* If we have a current selection and aren't extending it, move to the | ||
688 | @@ -2445,7 +2712,7 @@ | ||
689 | gint start_pos = entry->current_pos; | ||
690 | gint end_pos = entry->current_pos; | ||
691 | |||
692 | - gtk_entry_reset_im_context (entry); | ||
693 | + /* Hildon: code removed - backspace should not clear the word completion */ | ||
694 | |||
695 | if (!entry->editable) | ||
696 | return; | ||
697 | @@ -2515,7 +2782,8 @@ | ||
698 | GtkEditable *editable = GTK_EDITABLE (entry); | ||
699 | gint prev_pos; | ||
700 | |||
701 | - gtk_entry_reset_im_context (entry); | ||
702 | +/* gtk_entry_reset_im_context (entry); */ /*backspace should not clear | ||
703 | + the word completion*/ | ||
704 | |||
705 | if (!entry->editable || !entry->text) | ||
706 | return; | ||
707 | @@ -2883,21 +3151,28 @@ | ||
708 | ++i; | ||
709 | } | ||
710 | } | ||
711 | - | ||
712 | + | ||
713 | +#define HILDON_EDITED_CHARACTER_MS 600 /* 0.6 seconds */ | ||
714 | + | ||
715 | static PangoLayout * | ||
716 | gtk_entry_create_layout (GtkEntry *entry, | ||
717 | gboolean include_preedit) | ||
718 | { | ||
719 | GtkWidget *widget = GTK_WIDGET (entry); | ||
720 | + GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry); | ||
721 | PangoLayout *layout = gtk_widget_create_pango_layout (widget, NULL); | ||
722 | PangoAttrList *tmp_attrs = pango_attr_list_new (); | ||
723 | |||
724 | gchar *preedit_string = NULL; | ||
725 | gint preedit_length = 0; | ||
726 | PangoAttrList *preedit_attrs = NULL; | ||
727 | + gboolean show_last_char = FALSE; | ||
728 | |||
729 | pango_layout_set_single_paragraph_mode (layout, TRUE); | ||
730 | |||
731 | + gtk_widget_style_get (widget, "show-last-char", | ||
732 | + &show_last_char, NULL); | ||
733 | + | ||
734 | if (include_preedit) | ||
735 | { | ||
736 | gtk_im_context_get_preedit_string (entry->im_context, | ||
737 | @@ -3003,7 +3278,49 @@ | ||
738 | else | ||
739 | invisible_char = ' '; /* just pick a char */ | ||
740 | |||
741 | - append_char (str, invisible_char, entry->text_length); | ||
742 | + if (!show_last_char) | ||
743 | + append_char (str, invisible_char, entry->text_length); | ||
744 | + else if (show_last_char) | ||
745 | + { | ||
746 | + /* Hildon */ | ||
747 | + if (priv->hildon_edited_character_length > 0) | ||
748 | + { | ||
749 | + | ||
750 | + /* If we have an outstanding timeout, remove it, because the character it is set to hide | ||
751 | + * is already hidden now. We do this first to prevent possible race conditions if the timout | ||
752 | + * were to trigger while in here | ||
753 | + */ | ||
754 | + | ||
755 | + if (priv->hildon_edited_character_timeout) | ||
756 | + { | ||
757 | + g_source_remove( priv->hildon_edited_character_timeout ); | ||
758 | + priv->hildon_edited_character_timeout = FALSE; | ||
759 | + } | ||
760 | + | ||
761 | + /* Draw the secret character length-1 times, because the last char will be visible */ | ||
762 | + append_char (str, invisible_char, entry->text_length > 1 ? entry->text_length - 1 : 0); | ||
763 | + | ||
764 | + /* Add our visible char, the most recently inputted one */ | ||
765 | + g_string_append_len (str, (char *)&priv->hildon_edited_character, priv->hildon_edited_character_length); | ||
766 | + | ||
767 | + /* Now remove this last inputted character, don't need it anymore */ | ||
768 | + | ||
769 | + memset( priv->hildon_edited_character, 0x00, HILDON_EDITED_CHARACTER_MAX ); | ||
770 | + priv->hildon_edited_character_length = 0; | ||
771 | + | ||
772 | + priv->hildon_edited_character_timeout = g_timeout_add( HILDON_EDITED_CHARACTER_MS, (GSourceFunc) | ||
773 | + hildon_remove_visible_character, entry ); | ||
774 | + | ||
775 | + } | ||
776 | + else | ||
777 | + { | ||
778 | + /* No last character known. This could be for example because the application has filled | ||
779 | + * in the password already. In that case we of course don't want to view it | ||
780 | + */ | ||
781 | + append_char (str, invisible_char, entry->text_length); | ||
782 | + } | ||
783 | + } | ||
784 | + | ||
785 | pango_layout_set_text (layout, str->str, str->len); | ||
786 | g_string_free (str, TRUE); | ||
787 | } | ||
788 | @@ -3048,12 +3365,17 @@ | ||
789 | gint area_width, area_height; | ||
790 | gint y_pos; | ||
791 | PangoLayoutLine *line; | ||
792 | - | ||
793 | + gint border_x, border_y; | ||
794 | + | ||
795 | + gtk_widget_style_get (GTK_WIDGET (entry), "horizontal-border", &border_x, | ||
796 | + "vertical-border", &border_y, | ||
797 | + NULL); | ||
798 | + | ||
799 | layout = gtk_entry_ensure_layout (entry, TRUE); | ||
800 | |||
801 | get_text_area_size (entry, NULL, NULL, &area_width, &area_height); | ||
802 | |||
803 | - area_height = PANGO_SCALE * (area_height - 2 * INNER_BORDER); | ||
804 | + area_height = PANGO_SCALE * (area_height - 2 * border_y); | ||
805 | |||
806 | line = pango_layout_get_lines (layout)->data; | ||
807 | pango_layout_line_get_extents (line, NULL, &logical_rect); | ||
808 | @@ -3070,10 +3392,10 @@ | ||
809 | else if (y_pos + logical_rect.height > area_height) | ||
810 | y_pos = area_height - logical_rect.height; | ||
811 | |||
812 | - y_pos = INNER_BORDER + y_pos / PANGO_SCALE; | ||
813 | + y_pos = border_y + y_pos / PANGO_SCALE; | ||
814 | |||
815 | if (x) | ||
816 | - *x = INNER_BORDER - entry->scroll_offset; | ||
817 | + *x = border_x - entry->scroll_offset; | ||
818 | |||
819 | if (y) | ||
820 | *y = y_pos; | ||
821 | @@ -3083,6 +3405,10 @@ | ||
822 | gtk_entry_draw_text (GtkEntry *entry) | ||
823 | { | ||
824 | GtkWidget *widget; | ||
825 | + gint border_y, border_x; | ||
826 | + | ||
827 | + gtk_widget_style_get (GTK_WIDGET (entry), "horizontal-border", &border_x, | ||
828 | + "vertical-border", &border_y, NULL); | ||
829 | |||
830 | if (!entry->visible && entry->invisible_char == 0) | ||
831 | return; | ||
832 | @@ -3092,14 +3418,76 @@ | ||
833 | PangoLayout *layout = gtk_entry_ensure_layout (entry, TRUE); | ||
834 | gint x, y; | ||
835 | gint start_pos, end_pos; | ||
836 | + GdkRectangle clip_rect; | ||
837 | |||
838 | widget = GTK_WIDGET (entry); | ||
839 | |||
840 | get_layout_position (entry, &x, &y); | ||
841 | |||
842 | + /* Use a clipping rectangle so that we always get enough empty space around | ||
843 | + * the text. | ||
844 | + */ | ||
845 | + clip_rect.x = border_x; | ||
846 | + clip_rect.y = 0; | ||
847 | + | ||
848 | + gdk_drawable_get_size (entry->text_area, &clip_rect.width, &clip_rect.height); | ||
849 | + clip_rect.width -= border_x * 2; | ||
850 | + | ||
851 | + /*changes for Hildon | ||
852 | + *Reduce the size of the clip rect, so that only full characters are displayed | ||
853 | + */ | ||
854 | + | ||
855 | + /* NOTE: Commented out because it does not work with bidi text where | ||
856 | +the indexes are in random | ||
857 | + * left-right or right-left order. Code causes Pango assert aborts. Because gtkentry itself | ||
858 | + * is broken with regard to bidi anyway (bug #478) we ignore this requirement of the spec | ||
859 | + * until gtkentry itself is fixed. (bug #477) | ||
860 | + */ | ||
861 | + | ||
862 | + /* Better yet, let's enable this only when not in RTL mode */ | ||
863 | + | ||
864 | + /* Note: BUG #857. patched gtkentry crashed when pasting scalable fonts. This is pango problem | ||
865 | + * and we tested patched gtkentry with pango version 1.3.2 and it appears to be fixed. Section is commented | ||
866 | + out until we upgrade to new version of pango | ||
867 | + if (gtk_widget_get_direction( entry ) != GTK_TEXT_DIR_RTL) | ||
868 | + { | ||
869 | + PangoRectangle char_rect; // used for getting character's onscreen pos | ||
870 | + PangoLayoutIter *iter; // used to iterate over the text | ||
871 | + | ||
872 | + // get the position of the character currently at the clip border | ||
873 | + iter = get_char_at_pos( layout, (clip_rect.x + clip_rect.width + entry->scroll_offset), 0 ); | ||
874 | + if ( iter ) | ||
875 | + { | ||
876 | + // get the position of that character on the screen | ||
877 | + pango_layout_iter_get_char_extents( iter, &char_rect ); | ||
878 | + char_rect.x /= PANGO_SCALE; | ||
879 | + char_rect.x -= entry->scroll_offset; | ||
880 | + char_rect.width /= PANGO_SCALE; | ||
881 | + | ||
882 | + // if the ending position is > the clip rectangle, then the | ||
883 | + // character is only partially visible, and we should | ||
884 | + // clip the entire character. | ||
885 | + | ||
886 | + if ( char_rect.x + char_rect.width > clip_rect.x + clip_rect.width ) | ||
887 | + { | ||
888 | + clip_rect.width = char_rect.x; | ||
889 | + } | ||
890 | + | ||
891 | + pango_layout_iter_free( iter ); | ||
892 | + } | ||
893 | + | ||
894 | + } | ||
895 | + */ | ||
896 | + /******************************************************************/ | ||
897 | + | ||
898 | + gdk_gc_set_clip_rectangle (widget->style->text_gc [widget->state], &clip_rect); | ||
899 | + | ||
900 | gdk_draw_layout (entry->text_area, widget->style->text_gc [widget->state], | ||
901 | x, y, | ||
902 | layout); | ||
903 | + | ||
904 | + gdk_gc_set_clip_rectangle (widget->style->text_gc [widget->state], NULL); | ||
905 | + | ||
906 | |||
907 | if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start_pos, &end_pos)) | ||
908 | { | ||
909 | @@ -3128,7 +3516,7 @@ | ||
910 | { | ||
911 | GdkRectangle rect; | ||
912 | |||
913 | - rect.x = INNER_BORDER - entry->scroll_offset + ranges[2 * i]; | ||
914 | + rect.x = border_x - entry->scroll_offset + ranges[2 * i]; | ||
915 | rect.y = y; | ||
916 | rect.width = ranges[2 * i + 1]; | ||
917 | rect.height = logical_rect.height; | ||
918 | @@ -3177,14 +3565,18 @@ | ||
919 | { | ||
920 | GdkKeymap *keymap = gdk_keymap_get_for_display (gtk_widget_get_display (GTK_WIDGET (entry))); | ||
921 | PangoDirection keymap_direction = gdk_keymap_get_direction (keymap); | ||
922 | + gint border_x, border_y; | ||
923 | |||
924 | + gtk_widget_style_get (GTK_WIDGET (entry), "horizontal-border", &border_x, | ||
925 | + "vertical-border", &border_y, | ||
926 | + NULL); | ||
927 | if (GTK_WIDGET_DRAWABLE (entry)) | ||
928 | { | ||
929 | GtkWidget *widget = GTK_WIDGET (entry); | ||
930 | GdkRectangle cursor_location; | ||
931 | gboolean split_cursor; | ||
932 | |||
933 | - gint xoffset = INNER_BORDER - entry->scroll_offset; | ||
934 | + gint xoffset = border_x - entry->scroll_offset; | ||
935 | gint strong_x, weak_x; | ||
936 | gint text_area_height; | ||
937 | PangoDirection dir1 = PANGO_DIRECTION_NEUTRAL; | ||
938 | @@ -3221,9 +3613,9 @@ | ||
939 | } | ||
940 | |||
941 | cursor_location.x = xoffset + x1; | ||
942 | - cursor_location.y = INNER_BORDER; | ||
943 | + cursor_location.y = border_y; | ||
944 | cursor_location.width = 0; | ||
945 | - cursor_location.height = text_area_height - 2 * INNER_BORDER ; | ||
946 | + cursor_location.height = text_area_height - 2 * border_y; | ||
947 | |||
948 | draw_insertion_cursor (entry, | ||
949 | &cursor_location, TRUE, dir1, | ||
950 | @@ -3249,11 +3641,8 @@ | ||
951 | static void | ||
952 | gtk_entry_reset_im_context (GtkEntry *entry) | ||
953 | { | ||
954 | - if (entry->need_im_reset) | ||
955 | - { | ||
956 | - entry->need_im_reset = 0; | ||
957 | - gtk_im_context_reset (entry->im_context); | ||
958 | - } | ||
959 | + /* Hildon: We want reset to be sent more often */ | ||
960 | + gtk_im_context_reset (entry->im_context); | ||
961 | } | ||
962 | |||
963 | static gint | ||
964 | @@ -3266,8 +3655,12 @@ | ||
965 | gint pos; | ||
966 | gboolean trailing; | ||
967 | const gchar *text; | ||
968 | - gint cursor_index; | ||
969 | - | ||
970 | + gint border_x, cursor_index; | ||
971 | + | ||
972 | + gtk_widget_style_get (GTK_WIDGET (entry), "horizontal-border", &border_x, | ||
973 | + NULL); | ||
974 | + x -= border_x; | ||
975 | + | ||
976 | layout = gtk_entry_ensure_layout (entry, TRUE); | ||
977 | text = pango_layout_get_text (layout); | ||
978 | cursor_index = g_utf8_offset_to_pointer (text, entry->current_pos) - text; | ||
979 | @@ -3355,12 +3748,17 @@ | ||
980 | PangoLayout *layout; | ||
981 | PangoLayoutLine *line; | ||
982 | PangoRectangle logical_rect; | ||
983 | + gint border_x, border_y; | ||
984 | + | ||
985 | + gtk_widget_style_get (GTK_WIDGET (entry), "horizontal-border", &border_x, | ||
986 | + "vertical-border", &border_y, | ||
987 | + NULL); | ||
988 | |||
989 | if (!GTK_WIDGET_REALIZED (entry)) | ||
990 | return; | ||
991 | |||
992 | gdk_drawable_get_size (entry->text_area, &text_area_width, NULL); | ||
993 | - text_area_width -= 2 * INNER_BORDER; | ||
994 | + text_area_width -= 2 * border_x; | ||
995 | |||
996 | layout = gtk_entry_ensure_layout (entry, TRUE); | ||
997 | line = pango_layout_get_lines (layout)->data; | ||
998 | @@ -3390,13 +3788,13 @@ | ||
999 | entry->scroll_offset = CLAMP (entry->scroll_offset, min_offset, max_offset); | ||
1000 | |||
1001 | /* And make sure cursors are on screen. Note that the cursor is | ||
1002 | - * actually drawn one pixel into the INNER_BORDER space on | ||
1003 | + * actually drawn one pixel into the border_x space on | ||
1004 | * the right, when the scroll is at the utmost right. This | ||
1005 | * looks better to to me than confining the cursor inside the | ||
1006 | * border entirely, though it means that the cursor gets one | ||
1007 | * pixel closer to the edge of the widget on the right than | ||
1008 | * on the left. This might need changing if one changed | ||
1009 | - * INNER_BORDER from 2 to 1, as one would do on a | ||
1010 | + * border_x from 2 to 1, as one would do on a | ||
1011 | * small-screen-real-estate display. | ||
1012 | * | ||
1013 | * We always make sure that the strong cursor is on screen, and | ||
1014 | @@ -3430,6 +3828,52 @@ | ||
1015 | entry->scroll_offset += weak_xoffset - text_area_width; | ||
1016 | } | ||
1017 | |||
1018 | + /*Changes for Hildon | ||
1019 | + * now we make it so that if a character is partially visible, | ||
1020 | + * then we also scroll that off the screen. | ||
1021 | + */ | ||
1022 | + | ||
1023 | + /* NOTE: Commented out because it does not work with bidi text where the indexes are in random | ||
1024 | + * left-right or right-left order. Code causes Pango assert aborts. Because gtkentry itself | ||
1025 | + * is broken with regard to bidi anyway (bug #478) we ignore this requirement of the spec | ||
1026 | + * until gtkentry itself is fixed. (bug #477) | ||
1027 | + */ | ||
1028 | + | ||
1029 | + /* Better yet, let's disable this (for now) only when using RTL text */ | ||
1030 | + | ||
1031 | +/*Note: BUG #857. patched gtkentry crashed when pasting scalable fonts. This is pango problem | ||
1032 | + * and we tested patched gtkentry with pango version 1.3.2 and it appears to be fixed. Section is comment ed out until we upgrade to new version of pango | ||
1033 | + if (gtk_widget_get_direction( entry ) != GTK_TEXT_DIR_RTL) | ||
1034 | + { | ||
1035 | + PangoLayoutIter *iter = get_char_at_pos( layout, entry->scroll_offset, 0 ); | ||
1036 | + // if we found the char we were looking for | ||
1037 | + if ( iter ) | ||
1038 | + { | ||
1039 | + PangoRectangle char_rect; // used for getting character's onscreen pos | ||
1040 | + | ||
1041 | + // get the position of that character on the screen | ||
1042 | + pango_layout_iter_get_char_extents( iter, &char_rect ); | ||
1043 | + char_rect.x /= PANGO_SCALE; | ||
1044 | + | ||
1045 | + // if the starting position is < the current scroll offset, then the | ||
1046 | + // character is only partially visible, and we should scroll to the | ||
1047 | + // start of the next character instead | ||
1048 | + | ||
1049 | + if ( char_rect.x < entry->scroll_offset ) | ||
1050 | + { | ||
1051 | + if ( pango_layout_iter_next_char( iter ) ) | ||
1052 | + { | ||
1053 | + pango_layout_iter_get_char_extents( iter, &char_rect); | ||
1054 | + entry->scroll_offset = char_rect.x / PANGO_SCALE; | ||
1055 | + } | ||
1056 | + } | ||
1057 | + | ||
1058 | + pango_layout_iter_free( iter ); | ||
1059 | + } | ||
1060 | + | ||
1061 | + | ||
1062 | + }*/ | ||
1063 | + | ||
1064 | g_object_notify (G_OBJECT (entry), "scroll_offset"); | ||
1065 | } | ||
1066 | |||
1067 | @@ -3552,8 +3996,9 @@ | ||
1068 | pango_layout_get_log_attrs (layout, &log_attrs, &n_attrs); | ||
1069 | |||
1070 | /* Find the next word end */ | ||
1071 | + /*Hildon: cursor should seek to the start of the next word*/ | ||
1072 | new_pos++; | ||
1073 | - while (new_pos < n_attrs && !log_attrs[new_pos].is_word_end) | ||
1074 | + while (new_pos < n_attrs && !log_attrs[new_pos].is_word_start) | ||
1075 | new_pos++; | ||
1076 | |||
1077 | g_free (log_attrs); | ||
1078 | @@ -3648,14 +4093,9 @@ | ||
1079 | |||
1080 | if (entry->visible) | ||
1081 | return gtk_editable_get_chars (GTK_EDITABLE (entry), start, end); | ||
1082 | - else if (!entry->invisible_char) | ||
1083 | + /*Hildon: when not visible, no chars are public*/ | ||
1084 | + else | ||
1085 | return g_strdup (""); | ||
1086 | - else | ||
1087 | - { | ||
1088 | - GString *str = g_string_new (NULL); | ||
1089 | - append_char (str, entry->invisible_char, end - start); | ||
1090 | - return g_string_free (str, FALSE); | ||
1091 | - } | ||
1092 | } | ||
1093 | |||
1094 | static void | ||
1095 | @@ -3678,9 +4118,12 @@ | ||
1096 | |||
1097 | if (text) | ||
1098 | { | ||
1099 | - gint pos, start, end; | ||
1100 | + gint pos, start, end, index; | ||
1101 | GtkEntryCompletion *completion = gtk_entry_get_completion (entry); | ||
1102 | |||
1103 | + /* when pasting multiline text, ignore everything but the first line */ | ||
1104 | + for (index = 0; text[index] != 0 && text[index] != '\n'; index++); | ||
1105 | + | ||
1106 | if (completion) | ||
1107 | { | ||
1108 | g_signal_handler_block (entry, completion->priv->changed_id); | ||
1109 | @@ -3692,7 +4135,7 @@ | ||
1110 | gtk_editable_delete_text (editable, start, end); | ||
1111 | |||
1112 | pos = entry->current_pos; | ||
1113 | - gtk_editable_insert_text (editable, text, -1, &pos); | ||
1114 | + gtk_editable_insert_text (editable, text, index, &pos); | ||
1115 | gtk_editable_set_position (editable, pos); | ||
1116 | |||
1117 | if (completion) | ||
1118 | @@ -3888,6 +4331,7 @@ | ||
1119 | { | ||
1120 | g_return_if_fail (GTK_IS_ENTRY (entry)); | ||
1121 | |||
1122 | + g_object_set(G_OBJECT(entry->im_context), "visibility", visible, NULL); | ||
1123 | entry->visible = visible ? TRUE : FALSE; | ||
1124 | g_object_notify (G_OBJECT (entry), "visibility"); | ||
1125 | gtk_entry_recompute (entry); | ||
1126 | @@ -4569,6 +5013,7 @@ | ||
1127 | GdkEventButton *event) | ||
1128 | { | ||
1129 | PopupInfo *info = g_new (PopupInfo, 1); | ||
1130 | + GtkEntryPrivate *priv; | ||
1131 | |||
1132 | /* In order to know what entries we should make sensitive, we | ||
1133 | * ask for the current targets of the clipboard, and when | ||
1134 | @@ -4576,6 +5021,8 @@ | ||
1135 | */ | ||
1136 | info->entry = g_object_ref (entry); | ||
1137 | |||
1138 | + priv = GTK_ENTRY_GET_PRIVATE (entry); | ||
1139 | + | ||
1140 | if (event) | ||
1141 | { | ||
1142 | info->button = event->button; | ||
1143 | @@ -4591,6 +5038,8 @@ | ||
1144 | gdk_atom_intern ("TARGETS", FALSE), | ||
1145 | popup_targets_received, | ||
1146 | info); | ||
1147 | + | ||
1148 | + priv->menu_popped = TRUE; | ||
1149 | } | ||
1150 | |||
1151 | static gboolean | ||
1152 | @@ -5389,3 +5838,156 @@ | ||
1153 | |||
1154 | return completion; | ||
1155 | } | ||
1156 | + | ||
1157 | +static PangoLayoutIter *get_char_at_pos( PangoLayout *layout, gint x, gint y ) | ||
1158 | +{ | ||
1159 | + gint index = 0; /*the index of the first character */ | ||
1160 | + gint trailing = 0; /*not used*/ | ||
1161 | + PangoLayoutIter *iter; /*used to iterate over the text*/ | ||
1162 | + gboolean valid_char = TRUE; | ||
1163 | + | ||
1164 | + /*get the position of the character currently at the scroll offset*/ | ||
1165 | + pango_layout_xy_to_index( layout, x * PANGO_SCALE, y * PANGO_SCALE, &index, &trailing ); | ||
1166 | + iter = pango_layout_get_iter( layout ); | ||
1167 | + | ||
1168 | + /*iterate until we get to the character at the same index*/ | ||
1169 | + while ( valid_char && pango_layout_iter_get_index( iter ) != index ) | ||
1170 | + { | ||
1171 | + valid_char = pango_layout_iter_next_char( iter ); | ||
1172 | + } | ||
1173 | + | ||
1174 | + if ( valid_char == FALSE ) | ||
1175 | + iter = NULL; | ||
1176 | + | ||
1177 | + return iter; | ||
1178 | +} | ||
1179 | + | ||
1180 | +static void gtk_entry_update_scrolled_window( GtkEntry *entry) | ||
1181 | +{ | ||
1182 | + GtkWidget *parent; | ||
1183 | + GtkWidget *widget; | ||
1184 | + GtkWidget *direct_parent = NULL; | ||
1185 | + GtkScrolledWindow *sw = NULL; | ||
1186 | + gboolean need_update = FALSE; | ||
1187 | + GtkAdjustment *vadjustment; | ||
1188 | + gdouble value; | ||
1189 | + | ||
1190 | + widget = parent = GTK_WIDGET(entry); | ||
1191 | + if(parent->parent != NULL) | ||
1192 | + direct_parent = parent->parent; | ||
1193 | + while(parent && !GTK_WIDGET_TOPLEVEL(parent)) | ||
1194 | + { | ||
1195 | + if(GTK_IS_SCROLLED_WINDOW(parent)) | ||
1196 | + { | ||
1197 | + need_update = TRUE; | ||
1198 | + sw = GTK_SCROLLED_WINDOW(parent); | ||
1199 | + break; | ||
1200 | + } | ||
1201 | + parent = parent->parent; | ||
1202 | + } | ||
1203 | + | ||
1204 | + if(need_update) | ||
1205 | + { | ||
1206 | + gint x=0, y=0; | ||
1207 | + vadjustment = gtk_scrolled_window_get_vadjustment(sw); | ||
1208 | + value = gtk_adjustment_get_value(vadjustment); | ||
1209 | + | ||
1210 | + if(direct_parent != NULL) | ||
1211 | + gtk_widget_translate_coordinates( direct_parent, parent, | ||
1212 | + widget->allocation.x, widget->allocation.y, &x, &y ); | ||
1213 | + | ||
1214 | + if( (gdouble) y < 0 ) | ||
1215 | + { | ||
1216 | + value = value + (gdouble) y; | ||
1217 | + if (value < vadjustment->lower) | ||
1218 | + value = vadjustment->lower; | ||
1219 | + } | ||
1220 | + else if( (gdouble )y + widget->allocation.height > vadjustment->page_size) | ||
1221 | + { | ||
1222 | + value = value + (gdouble)y + widget->allocation.height | ||
1223 | + - vadjustment->page_size; | ||
1224 | + if(value > vadjustment->upper - vadjustment->page_size) | ||
1225 | + value = vadjustment->upper - vadjustment->page_size; | ||
1226 | + } | ||
1227 | + gtk_adjustment_set_value(vadjustment, value); | ||
1228 | + gtk_scrolled_window_set_vadjustment(sw, GTK_ADJUSTMENT(vadjustment)); | ||
1229 | + } | ||
1230 | +} | ||
1231 | + | ||
1232 | +/* | ||
1233 | + * gtk_entry_set_autocap: | ||
1234 | + * @entry: a #GtkEntry | ||
1235 | + * @autocap: autocap | ||
1236 | + * | ||
1237 | + * Sets autocapitalization of the widget. | ||
1238 | + */ | ||
1239 | +static void | ||
1240 | +gtk_entry_set_autocap (GtkEntry *entry, | ||
1241 | + gboolean autocap) | ||
1242 | +{ | ||
1243 | + g_return_if_fail (GTK_IS_ENTRY (entry)); | ||
1244 | + | ||
1245 | + if (gtk_entry_get_autocap (entry) != autocap) | ||
1246 | + { | ||
1247 | + g_object_set (G_OBJECT (entry->im_context), "autocap", autocap, NULL); | ||
1248 | + g_object_notify (G_OBJECT (entry), "autocap"); | ||
1249 | + } | ||
1250 | +} | ||
1251 | + | ||
1252 | +/* | ||
1253 | + * gtk_entry_get_autocap: | ||
1254 | + * @entry: a #GtkEntry | ||
1255 | + * | ||
1256 | + * Gets autocapitalization state of the widget. | ||
1257 | + * | ||
1258 | + * Return value: a state | ||
1259 | + */ | ||
1260 | +static gboolean | ||
1261 | +gtk_entry_get_autocap (GtkEntry *entry) | ||
1262 | +{ | ||
1263 | + gboolean autocap; | ||
1264 | + g_return_val_if_fail (GTK_IS_ENTRY (entry), FALSE); | ||
1265 | + | ||
1266 | + g_object_get (G_OBJECT (entry->im_context), "autocap", &autocap, NULL); | ||
1267 | + | ||
1268 | + return autocap; | ||
1269 | +} | ||
1270 | + | ||
1271 | +/* | ||
1272 | + * gtk_entry_set_input_mode: | ||
1273 | + * @entry: a #GtkEntry | ||
1274 | + * @autocap: input mode | ||
1275 | + * | ||
1276 | + * Sets autocapitalization of the widget. | ||
1277 | + */ | ||
1278 | +static void | ||
1279 | +gtk_entry_set_input_mode (GtkEntry *entry, | ||
1280 | + gint mode) | ||
1281 | +{ | ||
1282 | + g_return_if_fail (GTK_IS_ENTRY (entry)); | ||
1283 | + | ||
1284 | + if (gtk_entry_get_input_mode (entry) != mode) | ||
1285 | + { | ||
1286 | + g_object_set (G_OBJECT (entry->im_context), "input_mode", mode, NULL); | ||
1287 | + g_object_notify (G_OBJECT (entry), "input_mode"); | ||
1288 | + } | ||
1289 | +} | ||
1290 | + | ||
1291 | +/* | ||
1292 | + * gtk_entry_get_input_mode: | ||
1293 | + * @entry: a #GtkEntry | ||
1294 | + * | ||
1295 | + * Gets input mode of the widget. | ||
1296 | + * | ||
1297 | + * Return value: input mode | ||
1298 | + */ | ||
1299 | +static gint | ||
1300 | +gtk_entry_get_input_mode (GtkEntry *entry) | ||
1301 | +{ | ||
1302 | + gint mode; | ||
1303 | + g_return_val_if_fail (GTK_IS_ENTRY (entry), FALSE); | ||
1304 | + | ||
1305 | + g_object_get (G_OBJECT (entry->im_context), "input_mode", &mode, NULL); | ||
1306 | + | ||
1307 | + return mode; | ||
1308 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkenums.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkenums.h.diff deleted file mode 100644 index 5978100c97..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkenums.h.diff +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkenums.h 2003-07-18 21:52:02.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkenums.h 2005-04-06 16:19:36.500989368 +0300 | ||
3 | @@ -133,7 +133,11 @@ | ||
4 | GTK_ICON_SIZE_LARGE_TOOLBAR, | ||
5 | GTK_ICON_SIZE_BUTTON, | ||
6 | GTK_ICON_SIZE_DND, | ||
7 | - GTK_ICON_SIZE_DIALOG | ||
8 | + GTK_ICON_SIZE_DIALOG, | ||
9 | + HILDON_ICON_SIZE_26, | ||
10 | + HILDON_ICON_SIZE_40, | ||
11 | + HILDON_ICON_SIZE_50, | ||
12 | + HILDON_ICON_SIZE_64 | ||
13 | } GtkIconSize; | ||
14 | |||
15 | #ifndef GTK_DISABLE_DEPRECATED | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkfilesystem.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkfilesystem.c.diff deleted file mode 100644 index 87346c0260..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkfilesystem.c.diff +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkfilesystem.c 2004-09-13 19:00:00.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkfilesystem.c 2005-04-06 16:19:36.518986632 +0300 | ||
3 | @@ -1147,4 +1147,9 @@ | ||
4 | return fs; | ||
5 | } | ||
6 | |||
7 | +/* In Hildon we need to publish the previous symbol */ | ||
8 | +GtkFileSystem *hildon_gtk_file_system_create(const char *file_system_name) | ||
9 | +{ | ||
10 | + return _gtk_file_system_create (file_system_name); | ||
11 | +} | ||
12 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkfilesystem.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkfilesystem.h.diff deleted file mode 100644 index a555ca230b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkfilesystem.h.diff +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkfilesystem.h 2005-01-03 01:15:21.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkfilesystem.h 2005-04-06 16:19:36.518986632 +0300 | ||
3 | @@ -364,6 +364,9 @@ | ||
4 | |||
5 | GtkFileSystem *_gtk_file_system_create (const char *file_system_name); | ||
6 | |||
7 | +/* In Hildon we need to publish the previous symbol */ | ||
8 | +GtkFileSystem *hildon_gtk_file_system_create(const char *file_system_name); | ||
9 | + | ||
10 | G_END_DECLS | ||
11 | |||
12 | #endif /* __GTK_FILE_SYSTEM_H__ */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkframe.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkframe.c.diff deleted file mode 100644 index 6ca54c0c99..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkframe.c.diff +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkframe.c 2004-08-17 22:10:24.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkframe.c 2005-04-06 16:19:36.583976752 +0300 | ||
3 | @@ -24,6 +24,10 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2002-2003. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | #include <config.h> | ||
12 | #include <string.h> | ||
13 | #include "gtkalias.h" | ||
14 | @@ -33,6 +37,7 @@ | ||
15 | |||
16 | #define LABEL_PAD 1 | ||
17 | #define LABEL_SIDE_PAD 2 | ||
18 | +#define FRAME_BORDER_WIDTH 3 | ||
19 | |||
20 | enum { | ||
21 | PROP_0, | ||
22 | @@ -172,6 +177,14 @@ | ||
23 | P_("A widget to display in place of the usual frame label"), | ||
24 | GTK_TYPE_WIDGET, | ||
25 | G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
26 | + | ||
27 | + /* draw hildonlike frame */ | ||
28 | + gtk_widget_class_install_style_property (widget_class, | ||
29 | + g_param_spec_boolean ("hildonlike", | ||
30 | + _("hildonlike looks"), | ||
31 | + _("Draw frame, 1/0"), | ||
32 | + FALSE, | ||
33 | + G_PARAM_READABLE)); | ||
34 | |||
35 | widget_class->expose_event = gtk_frame_expose; | ||
36 | widget_class->size_request = gtk_frame_size_request; | ||
37 | @@ -276,7 +289,7 @@ | ||
38 | GtkWidget* | ||
39 | gtk_frame_new (const gchar *label) | ||
40 | { | ||
41 | - return g_object_new (GTK_TYPE_FRAME, "label", label, NULL); | ||
42 | + return g_object_new (GTK_TYPE_FRAME, "label", label, "border-width", FRAME_BORDER_WIDTH, NULL); | ||
43 | } | ||
44 | |||
45 | static void | ||
46 | @@ -533,6 +546,9 @@ | ||
47 | { | ||
48 | GtkFrame *frame; | ||
49 | gint x, y, width, height; | ||
50 | + gboolean hildonlike; | ||
51 | + | ||
52 | + gtk_widget_style_get ( widget, "hildonlike", &hildonlike, NULL ); | ||
53 | |||
54 | if (GTK_WIDGET_DRAWABLE (widget)) | ||
55 | { | ||
56 | @@ -543,7 +559,16 @@ | ||
57 | width = frame->child_allocation.width + 2 * widget->style->xthickness; | ||
58 | height = frame->child_allocation.height + 2 * widget->style->ythickness; | ||
59 | |||
60 | - if (frame->label_widget) | ||
61 | + if (hildonlike) { | ||
62 | + /* draw hildon application borders */ | ||
63 | + gtk_paint_box (widget->style, | ||
64 | + widget->window, | ||
65 | + GTK_WIDGET_STATE( widget ), | ||
66 | + GTK_SHADOW_OUT, | ||
67 | + NULL, widget, "frame", | ||
68 | + x, y, width, height); | ||
69 | + } | ||
70 | + else if (frame->label_widget) | ||
71 | { | ||
72 | GtkRequisition child_requisition; | ||
73 | gfloat xalign; | ||
74 | @@ -586,7 +611,7 @@ | ||
75 | { | ||
76 | if (GTK_WIDGET_DRAWABLE (widget)) | ||
77 | { | ||
78 | - gtk_frame_paint (widget, &event->area); | ||
79 | + gtk_frame_paint (widget, &event->area); | ||
80 | |||
81 | (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event); | ||
82 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhashtable.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhashtable.c.diff deleted file mode 100644 index fc6e15810b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhashtable.c.diff +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkhashtable.c 1970-01-01 02:00:00.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkhashtable.c 2005-04-06 16:19:36.596974776 +0300 | ||
3 | @@ -0,0 +1,99 @@ | ||
4 | +/* GTK - The GIMP Toolkit | ||
5 | + * Copyright (C) 2005 Nokia | ||
6 | + * Author: Jorn Baayen <jbaayen@gnome.org> | ||
7 | + * | ||
8 | + * This library is free software; you can redistribute it and/or | ||
9 | + * modify it under the terms of the GNU Lesser General Public | ||
10 | + * License as published by the Free Software Foundation; either | ||
11 | + * version 2 of the License, or (at your option) any later version. | ||
12 | + * | ||
13 | + * This library is distributed in the hope that it will be useful, | ||
14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | + * Lesser General Public License for more details. | ||
17 | + * | ||
18 | + * You should have received a copy of the GNU Lesser General Public | ||
19 | + * License along with this library; if not, write to the | ||
20 | + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
21 | + * Boston, MA 02111-1307, USA. | ||
22 | + */ | ||
23 | + | ||
24 | +#include <config.h> | ||
25 | +#include "gtkhashtable.h" | ||
26 | + | ||
27 | +static gpointer parent_class = NULL; | ||
28 | + | ||
29 | +static void _gtk_hash_table_init (GtkHashTable *hash_table); | ||
30 | +static void _gtk_hash_table_class_init (GtkHashTableClass *klass); | ||
31 | +static void _gtk_hash_table_finalize (GObject *object); | ||
32 | + | ||
33 | +GType | ||
34 | +_gtk_hash_table_get_type (void) | ||
35 | +{ | ||
36 | + static GType hash_table_type = 0; | ||
37 | + | ||
38 | + if (!hash_table_type) | ||
39 | + { | ||
40 | + static const GTypeInfo hash_table_info = | ||
41 | + { | ||
42 | + sizeof (GtkHashTableClass), | ||
43 | + NULL, /* base_init */ | ||
44 | + NULL, /* base_finalize */ | ||
45 | + (GClassInitFunc) _gtk_hash_table_class_init, | ||
46 | + NULL, /* class_finalize */ | ||
47 | + NULL, /* class_data */ | ||
48 | + sizeof (GtkHashTable), | ||
49 | + 0, /* n_preallocs */ | ||
50 | + (GInstanceInitFunc) _gtk_hash_table_init, | ||
51 | + }; | ||
52 | + | ||
53 | + hash_table_type = | ||
54 | + g_type_register_static (G_TYPE_OBJECT, "GtkHashTable", | ||
55 | + &hash_table_info, 0); | ||
56 | + } | ||
57 | + | ||
58 | + return hash_table_type; | ||
59 | +} | ||
60 | + | ||
61 | +static void | ||
62 | +_gtk_hash_table_init (GtkHashTable *hash_table) | ||
63 | +{ | ||
64 | + hash_table->hash = g_hash_table_new_full (g_str_hash, g_str_equal, | ||
65 | + g_free, g_free); | ||
66 | +} | ||
67 | + | ||
68 | +static void | ||
69 | +_gtk_hash_table_class_init (GtkHashTableClass *klass) | ||
70 | +{ | ||
71 | + GObjectClass *object_class = G_OBJECT_CLASS (klass); | ||
72 | + | ||
73 | + parent_class = g_type_class_peek_parent (klass); | ||
74 | + | ||
75 | + object_class->finalize = _gtk_hash_table_finalize; | ||
76 | +} | ||
77 | + | ||
78 | +static void | ||
79 | +_gtk_hash_table_finalize (GObject *object) | ||
80 | +{ | ||
81 | + GtkHashTable *hash_table = GTK_HASH_TABLE (object); | ||
82 | + | ||
83 | + g_hash_table_destroy (hash_table->hash); | ||
84 | + | ||
85 | + G_OBJECT_CLASS (parent_class)->finalize (object); | ||
86 | +} | ||
87 | + | ||
88 | +/** | ||
89 | + * _gtk_hash_table_new: | ||
90 | + * | ||
91 | + * Creates a new #GtkHashTable. This is a #GHashTable wrapped in a GObject, | ||
92 | + * thereby supporting refcounting. | ||
93 | + * | ||
94 | + * Return value: a new #GtkHashTable | ||
95 | + **/ | ||
96 | +GtkHashTable* | ||
97 | +_gtk_hash_table_new (void) | ||
98 | +{ | ||
99 | + return g_object_new (GTK_TYPE_HASH_TABLE, NULL); | ||
100 | +} | ||
101 | + | ||
102 | + | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhashtable.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhashtable.h.diff deleted file mode 100644 index 733d68c35a..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhashtable.h.diff +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkhashtable.h 1970-01-01 02:00:00.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkhashtable.h 2005-04-06 16:19:36.606973256 +0300 | ||
3 | @@ -0,0 +1,61 @@ | ||
4 | +/* GTK - The GIMP Toolkit | ||
5 | + * Copyright (C) 2005 Nokia | ||
6 | + * Author: Jorn Baayen <jbaayen@gnome.org> | ||
7 | + * | ||
8 | + * This library is free software; you can redistribute it and/or | ||
9 | + * modify it under the terms of the GNU Lesser General Public | ||
10 | + * License as published by the Free Software Foundation; either | ||
11 | + * version 2 of the License, or (at your option) any later version. | ||
12 | + * | ||
13 | + * This library is distributed in the hope that it will be useful, | ||
14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | + * Lesser General Public License for more details. | ||
17 | + * | ||
18 | + * You should have received a copy of the GNU Lesser General Public | ||
19 | + * License along with this library; if not, write to the | ||
20 | + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
21 | + * Boston, MA 02111-1307, USA. | ||
22 | + */ | ||
23 | + | ||
24 | +#ifndef __GTK_HASH_TABLE_H__ | ||
25 | +#define __GTK_HASH_TABLE_H__ | ||
26 | + | ||
27 | +#include <glib-object.h> | ||
28 | + | ||
29 | +#ifdef __cplusplus | ||
30 | +extern "C" { | ||
31 | +#endif /* __cplusplus */ | ||
32 | + | ||
33 | +typedef struct _GtkHashTable GtkHashTable; | ||
34 | +typedef struct _GtkHashTableClass GtkHashTableClass; | ||
35 | + | ||
36 | +#define GTK_TYPE_HASH_TABLE (_gtk_hash_table_get_type ()) | ||
37 | +#define GTK_HASH_TABLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_HASH_TABLE, GtkHashTable)) | ||
38 | +#define GTK_HASH_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HASH_TABLE, GtkHashTableClass)) | ||
39 | +#define GTK_IS_HASH_TABLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_HASH_TABLE)) | ||
40 | +#define GTK_IS_HASH_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HASH_TABLE)) | ||
41 | +#define GTK_HASH_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HASH_TABLE, GtkHashTableClass)) | ||
42 | + | ||
43 | +struct _GtkHashTable | ||
44 | +{ | ||
45 | + GObject parent_instance; | ||
46 | + | ||
47 | + GHashTable *hash; | ||
48 | +}; | ||
49 | + | ||
50 | +struct _GtkHashTableClass | ||
51 | +{ | ||
52 | + GObjectClass parent_class; | ||
53 | +}; | ||
54 | + | ||
55 | +GType _gtk_hash_table_get_type (void) G_GNUC_CONST; | ||
56 | +GtkHashTable* _gtk_hash_table_new (void); | ||
57 | + | ||
58 | +#ifdef __cplusplus | ||
59 | +} | ||
60 | +#endif /* __cplusplus */ | ||
61 | + | ||
62 | +#endif /* __GTK_HASH_TABLE_H__ */ | ||
63 | + | ||
64 | + | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhbbox.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhbbox.c.diff deleted file mode 100644 index e43db37f5c..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhbbox.c.diff +++ /dev/null | |||
@@ -1,344 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkhbbox.c 2004-08-09 19:59:52.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkhbbox.c 2005-04-06 16:19:36.644967480 +0300 | ||
3 | @@ -24,10 +24,20 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | +/* Hildon : Button spacing according to the spec. */ | ||
12 | +#define HILDON_BUTTON_SPACING 5 | ||
13 | +/* Selecting hetefogenous mode for a childlayout */ | ||
14 | +#define GTK_BUTTONBOX_HETEROGENOUS 6 | ||
15 | + | ||
16 | #include <config.h> | ||
17 | #include "gtkalias.h" | ||
18 | #include "gtkhbbox.h" | ||
19 | - | ||
20 | +/* Hildon : We need this to mess with buttons graphics. */ | ||
21 | +#include "gtkbutton.h" | ||
22 | |||
23 | static void gtk_hbutton_box_class_init (GtkHButtonBoxClass *klass); | ||
24 | static void gtk_hbutton_box_init (GtkHButtonBox *box); | ||
25 | @@ -36,6 +46,15 @@ | ||
26 | static void gtk_hbutton_box_size_allocate (GtkWidget *widget, | ||
27 | GtkAllocation *allocation); | ||
28 | |||
29 | +static void osso_gtk_hbutton_child_showhide_handler (GtkWidget *widget, | ||
30 | + gpointer user_data); | ||
31 | +static void osso_gtk_hbutton_box_remove_child_signal_handlers (GtkHButtonBox *hbbox, | ||
32 | + GtkWidget *removed_widget, | ||
33 | + gpointer data); | ||
34 | +static void osso_gtk_hbutton_box_find_button_detail (GtkHButtonBox *hbbox, | ||
35 | + GtkWidget *addremovewidget, | ||
36 | + gpointer data); | ||
37 | + | ||
38 | static gint default_spacing = 30; | ||
39 | static gint default_layout_style = GTK_BUTTONBOX_EDGE; | ||
40 | |||
41 | @@ -76,12 +95,23 @@ | ||
42 | |||
43 | widget_class->size_request = gtk_hbutton_box_size_request; | ||
44 | widget_class->size_allocate = gtk_hbutton_box_size_allocate; | ||
45 | + | ||
46 | + /* HILDON: | ||
47 | + * Name buttons only if hildon like style property is set | ||
48 | + */ | ||
49 | + gtk_widget_class_install_style_property (widget_class, | ||
50 | + g_param_spec_boolean | ||
51 | + ( "hildonlike", | ||
52 | + "hildonlike looks", | ||
53 | + "Name buttons, 1/0", | ||
54 | + FALSE, | ||
55 | + G_PARAM_READABLE) ); | ||
56 | } | ||
57 | |||
58 | static void | ||
59 | gtk_hbutton_box_init (GtkHButtonBox *hbutton_box) | ||
60 | { | ||
61 | - /* button_box_init has done everything allready */ | ||
62 | + /* button_box_init has done everything allready */ | ||
63 | } | ||
64 | |||
65 | GtkWidget* | ||
66 | @@ -91,6 +121,24 @@ | ||
67 | |||
68 | hbutton_box = g_object_new (GTK_TYPE_HBUTTON_BOX, NULL); | ||
69 | |||
70 | + /* Attach signal handler for 'hildonizing' buttons. | ||
71 | + * gtk_hbutton_box_hildonize_buttons will check the name | ||
72 | + * and if it is something we're interested in i.e. | ||
73 | + * | ||
74 | + * hildon_dialogbuttons | ||
75 | + * hildon_viewbuttons | ||
76 | + * | ||
77 | + * it will do the hildonizing | ||
78 | + */ | ||
79 | + g_signal_connect_after (G_OBJECT (hbutton_box), "remove", | ||
80 | + G_CALLBACK (osso_gtk_hbutton_box_remove_child_signal_handlers), | ||
81 | + NULL); | ||
82 | + g_signal_connect_after( G_OBJECT( hbutton_box ), "add", | ||
83 | + G_CALLBACK( osso_gtk_hbutton_box_find_button_detail ), | ||
84 | + NULL ); | ||
85 | + g_signal_connect_after( G_OBJECT( hbutton_box ), "remove", | ||
86 | + G_CALLBACK( osso_gtk_hbutton_box_find_button_detail ), | ||
87 | + NULL ); | ||
88 | return GTK_WIDGET (hbutton_box); | ||
89 | } | ||
90 | |||
91 | @@ -145,6 +193,11 @@ | ||
92 | gint child_height; | ||
93 | gint spacing; | ||
94 | GtkButtonBoxStyle layout; | ||
95 | + gint child_xpad=0; | ||
96 | + GtkBoxChild *child_req; | ||
97 | + GList *children_req; | ||
98 | + GtkRequisition treq; | ||
99 | + | ||
100 | |||
101 | box = GTK_BOX (widget); | ||
102 | bbox = GTK_BUTTON_BOX (widget); | ||
103 | @@ -159,6 +212,12 @@ | ||
104 | &child_width, | ||
105 | &child_height); | ||
106 | |||
107 | + /* should GTK_BUTTONBOX_HETEROGENOUS add into the GtkButtonBoxStyle | ||
108 | + enum struct | ||
109 | + */ | ||
110 | + if( !box->homogeneous ) | ||
111 | + layout = GTK_BUTTONBOX_HETEROGENOUS; | ||
112 | + | ||
113 | if (nvis_children == 0) | ||
114 | { | ||
115 | requisition->width = 0; | ||
116 | @@ -177,11 +236,36 @@ | ||
117 | case GTK_BUTTONBOX_END: | ||
118 | requisition->width = nvis_children*child_width + ((nvis_children-1)*spacing); | ||
119 | break; | ||
120 | + case GTK_BUTTONBOX_HETEROGENOUS: | ||
121 | + children_req = GTK_BOX (box)->children; | ||
122 | + child_req = children_req->data; | ||
123 | + requisition->width = 0; | ||
124 | + | ||
125 | + while (children_req) | ||
126 | + { | ||
127 | + child_req = children_req->data; | ||
128 | + children_req = children_req->next; | ||
129 | + | ||
130 | + if (GTK_WIDGET_VISIBLE (child_req->widget)) | ||
131 | + { | ||
132 | + gtk_widget_get_child_requisition( child_req->widget, | ||
133 | + &(treq) ); | ||
134 | + requisition->width += treq.width; | ||
135 | + | ||
136 | + gtk_widget_style_get(widget, | ||
137 | + "child-internal-pad-x", | ||
138 | + &(child_xpad), NULL); | ||
139 | + requisition->width += (child_xpad*2); | ||
140 | + } | ||
141 | + } | ||
142 | + requisition->width += ((nvis_children-1)*spacing); | ||
143 | + | ||
144 | + break; | ||
145 | default: | ||
146 | g_assert_not_reached(); | ||
147 | break; | ||
148 | } | ||
149 | - | ||
150 | + | ||
151 | requisition->height = child_height; | ||
152 | } | ||
153 | |||
154 | @@ -227,6 +311,10 @@ | ||
155 | &child_height); | ||
156 | widget->allocation = *allocation; | ||
157 | width = allocation->width - GTK_CONTAINER (box)->border_width*2; | ||
158 | + | ||
159 | + if( !base_box->homogeneous ) | ||
160 | + layout = GTK_BUTTONBOX_HETEROGENOUS; | ||
161 | + | ||
162 | switch (layout) | ||
163 | { | ||
164 | case GTK_BUTTONBOX_SPREAD: | ||
165 | @@ -264,6 +352,39 @@ | ||
166 | - GTK_CONTAINER (box)->border_width; | ||
167 | secondary_x = allocation->x + GTK_CONTAINER (box)->border_width; | ||
168 | break; | ||
169 | + case GTK_BUTTONBOX_HETEROGENOUS: | ||
170 | + { | ||
171 | + gint sumwidth = 0; | ||
172 | + GtkBoxChild *child_h; | ||
173 | + GList *children_h = GTK_BOX (box)->children; | ||
174 | + /* heterogenous sized childs onto center */ | ||
175 | + childspacing = spacing; | ||
176 | + child_h = children_h->data; | ||
177 | + | ||
178 | + while (children_h ) | ||
179 | + { | ||
180 | + if ( g_list_length (children_h) == 0 ) break; | ||
181 | + | ||
182 | + child_h = children_h->data; | ||
183 | + children_h = children_h->next; | ||
184 | + | ||
185 | + if (GTK_WIDGET_VISIBLE (child_h->widget)) | ||
186 | + { | ||
187 | + gint child_xpad = 0; | ||
188 | + GtkRequisition treq; | ||
189 | + gtk_widget_get_child_requisition( child_h->widget, &(treq) ); | ||
190 | + sumwidth += treq.width; | ||
191 | + | ||
192 | + gtk_widget_style_get(widget, | ||
193 | + "child-internal-pad-x", | ||
194 | + &(child_xpad), NULL); | ||
195 | + sumwidth += (child_xpad*2); | ||
196 | + } | ||
197 | + } | ||
198 | + x = secondary_x = allocation->x + | ||
199 | + ( (allocation->width - sumwidth - (spacing * (nvis_children - 1)))/2 ); | ||
200 | + break; | ||
201 | + } | ||
202 | default: | ||
203 | g_assert_not_reached(); | ||
204 | break; | ||
205 | @@ -282,10 +403,33 @@ | ||
206 | |||
207 | if (GTK_WIDGET_VISIBLE (child->widget)) | ||
208 | { | ||
209 | - child_allocation.width = child_width; | ||
210 | child_allocation.height = child_height; | ||
211 | child_allocation.y = y; | ||
212 | |||
213 | + if(layout != GTK_BUTTONBOX_HETEROGENOUS) | ||
214 | + { | ||
215 | + child_allocation.width = child_width; | ||
216 | + } | ||
217 | + else /* if layout will be hetergenous */ | ||
218 | + { | ||
219 | + gint child_hwidth = 0; | ||
220 | + GtkRequisition treq; | ||
221 | + gint child_xpad = 0; | ||
222 | + | ||
223 | + gtk_widget_get_child_requisition( child->widget, &(treq) ); | ||
224 | + child_hwidth += treq.width; | ||
225 | + | ||
226 | + gtk_widget_style_get(widget, | ||
227 | + "child-internal-pad-x", | ||
228 | + &child_xpad, NULL); | ||
229 | + child_hwidth += (child_xpad*2); | ||
230 | + | ||
231 | + child_allocation.width = child_hwidth; | ||
232 | + childspace = child_hwidth + childspacing; | ||
233 | + | ||
234 | + } | ||
235 | + | ||
236 | + /* calculate the horizontal location */ | ||
237 | if (child->is_secondary) | ||
238 | { | ||
239 | child_allocation.x = secondary_x; | ||
240 | @@ -304,4 +448,104 @@ | ||
241 | } | ||
242 | } | ||
243 | } | ||
244 | + | ||
245 | +/* Function to wrap "hide" and "show" signals to call | ||
246 | + * osso_gtk_hbutton_box_find_button_detail -function.*/ | ||
247 | +static void osso_gtk_hbutton_child_showhide_handler (GtkWidget *widget, | ||
248 | + gpointer user_data) | ||
249 | +{ | ||
250 | + osso_gtk_hbutton_box_find_button_detail (widget, GTK_WIDGET (user_data), NULL); | ||
251 | +} | ||
252 | |||
253 | +/* Function to remove "show"&"hide" signal handlers | ||
254 | + * from a child when it's removed. */ | ||
255 | +static void osso_gtk_hbutton_box_remove_child_signal_handlers (GtkHButtonBox *hbbox, | ||
256 | + GtkWidget *removed_widget, | ||
257 | + gpointer data) | ||
258 | +{ | ||
259 | + g_signal_handlers_disconnect_by_func (G_OBJECT (removed_widget), osso_gtk_hbutton_box_find_button_detail, hbbox); | ||
260 | +} | ||
261 | + | ||
262 | +/* Signal handler called when we have to set | ||
263 | + * painting detail values for buttons in this | ||
264 | + * gtk_horizontal_button_box. | ||
265 | + */ | ||
266 | +static void osso_gtk_hbutton_box_find_button_detail (GtkHButtonBox *hbbox, | ||
267 | + GtkWidget *addremovewidget, | ||
268 | + gpointer data) | ||
269 | +{ | ||
270 | + GList *child; | ||
271 | + gint visible_buttons = 0; | ||
272 | + gint secondary_buttons = 0; | ||
273 | + GtkWidget *leftmost_button = NULL; | ||
274 | + GtkWidget *rightmost_button = NULL; | ||
275 | + | ||
276 | + for( child = GTK_BOX (hbbox)->children ; child ; child = child->next ) | ||
277 | + { | ||
278 | + GtkBoxChild *box_child = child->data; | ||
279 | + GtkWidget *child_widget = box_child->widget; | ||
280 | + gulong signal_handler = g_signal_handler_find ( G_OBJECT( child_widget ), | ||
281 | + G_SIGNAL_MATCH_FUNC, | ||
282 | + 0, 0, NULL, | ||
283 | + G_CALLBACK (osso_gtk_hbutton_child_showhide_handler), | ||
284 | + NULL); | ||
285 | + | ||
286 | + if (signal_handler == 0) | ||
287 | + { | ||
288 | + g_signal_connect_object ( G_OBJECT( child_widget ), | ||
289 | + "hide", | ||
290 | + G_CALLBACK ( osso_gtk_hbutton_child_showhide_handler ), | ||
291 | + hbbox, G_CONNECT_SWAPPED); | ||
292 | + g_signal_connect_object ( G_OBJECT( child_widget ), | ||
293 | + "show", | ||
294 | + G_CALLBACK ( osso_gtk_hbutton_child_showhide_handler ), | ||
295 | + hbbox, G_CONNECT_SWAPPED); | ||
296 | + } | ||
297 | + | ||
298 | + if ((GTK_WIDGET_VISIBLE (child_widget)) && | ||
299 | + (GTK_IS_BUTTON (child_widget))) | ||
300 | + visible_buttons++; | ||
301 | + else | ||
302 | + continue; | ||
303 | + | ||
304 | + if (leftmost_button == NULL) | ||
305 | + leftmost_button = child_widget; | ||
306 | + | ||
307 | + if (secondary_buttons == 0) | ||
308 | + rightmost_button = child_widget; | ||
309 | + else | ||
310 | + if (box_child->is_secondary) | ||
311 | + { | ||
312 | + rightmost_button = child_widget; | ||
313 | + secondary_buttons++; | ||
314 | + } | ||
315 | + | ||
316 | + if (box_child->is_secondary) | ||
317 | + rightmost_button = child_widget; | ||
318 | + } | ||
319 | + | ||
320 | + if (visible_buttons == 0) | ||
321 | + return; | ||
322 | + | ||
323 | + for( child = GTK_BOX (hbbox)->children ; child ; child = child->next ) | ||
324 | + { | ||
325 | + GtkBoxChild *box_child = child->data; | ||
326 | + GtkWidget *child_widget = box_child->widget; | ||
327 | + OssoGtkButtonAttachFlags attachflags = OSSO_GTK_BUTTON_ATTACH_NORTH | OSSO_GTK_BUTTON_ATTACH_SOUTH; | ||
328 | + gboolean automatic_detail; | ||
329 | + | ||
330 | + if (!((GTK_WIDGET_VISIBLE (child_widget)) && | ||
331 | + (GTK_IS_BUTTON (child_widget)))) | ||
332 | + continue; | ||
333 | + | ||
334 | + if (child_widget == leftmost_button) | ||
335 | + attachflags |= OSSO_GTK_BUTTON_ATTACH_WEST; | ||
336 | + | ||
337 | + if (child_widget == rightmost_button) | ||
338 | + attachflags |= OSSO_GTK_BUTTON_ATTACH_EAST; | ||
339 | + | ||
340 | + g_object_get (G_OBJECT (child_widget), "automatic_detail", &automatic_detail, NULL); | ||
341 | + if (automatic_detail == TRUE) | ||
342 | + g_object_set (G_OBJECT (child_widget), "detail", osso_gtk_button_attach_details[attachflags], NULL); | ||
343 | + } | ||
344 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhseparator.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhseparator.c.diff deleted file mode 100644 index 814c6ae5c7..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkhseparator.c.diff +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkhseparator.c 2004-08-09 19:59:52.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkhseparator.c 2005-04-06 16:19:36.667963984 +0300 | ||
3 | @@ -91,13 +91,29 @@ | ||
4 | gtk_hseparator_expose (GtkWidget *widget, | ||
5 | GdkEventExpose *event) | ||
6 | { | ||
7 | - if (GTK_WIDGET_DRAWABLE (widget)) | ||
8 | - gtk_paint_hline (widget->style, widget->window, GTK_WIDGET_STATE (widget), | ||
9 | - &event->area, widget, "hseparator", | ||
10 | - widget->allocation.x, | ||
11 | - widget->allocation.x + widget->allocation.width - 1, | ||
12 | - widget->allocation.y + (widget->allocation.height - | ||
13 | - widget->style->ythickness) / 2); | ||
14 | + gboolean hildonlike_drawing = FALSE; | ||
15 | + gtk_widget_style_get ( widget, "hildonlike-drawing", &hildonlike_drawing, NULL ); | ||
16 | |||
17 | - return FALSE; | ||
18 | + if (GTK_WIDGET_DRAWABLE (widget)) | ||
19 | + { | ||
20 | + if(hildonlike_drawing) | ||
21 | + gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, | ||
22 | + GTK_SHADOW_NONE, &event->area, widget, "hseparator", | ||
23 | + widget->allocation.x, | ||
24 | + widget->allocation.y + (widget->allocation.height - | ||
25 | + widget->style->ythickness) / 2, | ||
26 | + widget->allocation.width - 1, | ||
27 | + widget->style->ythickness); | ||
28 | + else | ||
29 | + gtk_paint_hline (widget->style, widget->window, GTK_STATE_NORMAL, | ||
30 | + &event->area, widget, "hseparator", | ||
31 | + widget->allocation.x, | ||
32 | + widget->allocation.x + widget->allocation.width - 1, | ||
33 | + widget->allocation.y + (widget->allocation.height - | ||
34 | + widget->style->ythickness) / 2); | ||
35 | + } | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + return FALSE; | ||
40 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkiconfactory.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkiconfactory.c.diff deleted file mode 100644 index 91874b9ce4..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkiconfactory.c.diff +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkiconfactory.c 2005-01-03 16:44:33.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkiconfactory.c 2005-04-06 16:19:36.804943160 +0300 | ||
3 | @@ -813,7 +813,7 @@ | ||
4 | { | ||
5 | if (icon_sizes == NULL) | ||
6 | { | ||
7 | -#define NUM_BUILTIN_SIZES 7 | ||
8 | +#define NUM_BUILTIN_SIZES 11 | ||
9 | gint i; | ||
10 | |||
11 | icon_aliases = g_hash_table_new (g_str_hash, g_str_equal); | ||
12 | @@ -863,7 +863,27 @@ | ||
13 | icon_sizes[GTK_ICON_SIZE_DIALOG].width = 48; | ||
14 | icon_sizes[GTK_ICON_SIZE_DIALOG].height = 48; | ||
15 | |||
16 | - g_assert ((GTK_ICON_SIZE_DIALOG + 1) == NUM_BUILTIN_SIZES); | ||
17 | + icon_sizes[HILDON_ICON_SIZE_26].size = HILDON_ICON_SIZE_26; | ||
18 | + icon_sizes[HILDON_ICON_SIZE_26].name = "hildon-26"; | ||
19 | + icon_sizes[HILDON_ICON_SIZE_26].width = 26; | ||
20 | + icon_sizes[HILDON_ICON_SIZE_26].height = 26; | ||
21 | + | ||
22 | + icon_sizes[HILDON_ICON_SIZE_40].size = HILDON_ICON_SIZE_40; | ||
23 | + icon_sizes[HILDON_ICON_SIZE_40].name = "hildon-40"; | ||
24 | + icon_sizes[HILDON_ICON_SIZE_40].width = 40; | ||
25 | + icon_sizes[HILDON_ICON_SIZE_40].height = 40; | ||
26 | + | ||
27 | + icon_sizes[HILDON_ICON_SIZE_50].size = HILDON_ICON_SIZE_50; | ||
28 | + icon_sizes[HILDON_ICON_SIZE_50].name = "hildon-50"; | ||
29 | + icon_sizes[HILDON_ICON_SIZE_50].width = 50; | ||
30 | + icon_sizes[HILDON_ICON_SIZE_50].height = 50; | ||
31 | + | ||
32 | + icon_sizes[HILDON_ICON_SIZE_64].size = HILDON_ICON_SIZE_64; | ||
33 | + icon_sizes[HILDON_ICON_SIZE_64].name = "hildon-64"; | ||
34 | + icon_sizes[HILDON_ICON_SIZE_64].width = 54; | ||
35 | + icon_sizes[HILDON_ICON_SIZE_64].height = 64; | ||
36 | + | ||
37 | + g_assert ((HILDON_ICON_SIZE_64 + 1) == NUM_BUILTIN_SIZES); | ||
38 | |||
39 | /* Alias everything to itself. */ | ||
40 | i = 1; /* skip invalid size */ | ||
41 | @@ -1658,7 +1678,7 @@ | ||
42 | gint width, height, pixel_size; | ||
43 | gint *sizes, *s, dist; | ||
44 | GError *error = NULL; | ||
45 | - | ||
46 | + | ||
47 | if (widget && gtk_widget_has_screen (widget)) | ||
48 | screen = gtk_widget_get_screen (widget); | ||
49 | else if (style && style->colormap) | ||
50 | @@ -1734,8 +1754,10 @@ | ||
51 | tmp_source.type = GTK_ICON_SOURCE_PIXBUF; | ||
52 | tmp_source.source.pixbuf = tmp_pixbuf; | ||
53 | |||
54 | + /* Hildon: no scaling allowed for Hildon icons */ | ||
55 | pixbuf = gtk_style_render_icon (style, &tmp_source, | ||
56 | - direction, state, -1, | ||
57 | + direction, state, | ||
58 | + (size < HILDON_ICON_SIZE_26) ? -1 : size, | ||
59 | widget, detail); | ||
60 | |||
61 | if (!pixbuf) | ||
62 | @@ -1818,7 +1840,6 @@ | ||
63 | { | ||
64 | /* This icon can be used for any direction/state/size */ | ||
65 | static GtkIconSource fallback_source = GTK_ICON_SOURCE_INIT (TRUE, TRUE, TRUE); | ||
66 | - | ||
67 | if (fallback_source.type == GTK_ICON_SOURCE_EMPTY) | ||
68 | { | ||
69 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_inline (-1, stock_missing_image_24, FALSE, NULL); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkicontheme.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkicontheme.c.diff deleted file mode 100644 index ff9cf71096..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkicontheme.c.diff +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkicontheme.c 2005-03-01 17:24:48.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkicontheme.c 2005-04-06 16:19:36.807942704 +0300 | ||
3 | @@ -64,7 +64,8 @@ | ||
4 | ICON_SUFFIX_XPM = 1 << 0, | ||
5 | ICON_SUFFIX_SVG = 1 << 1, | ||
6 | ICON_SUFFIX_PNG = 1 << 2, | ||
7 | - HAS_ICON_FILE = 1 << 3 | ||
8 | + HAS_ICON_FILE = 1 << 3, | ||
9 | + ICON_SUFFIX_ANI = 1 << 4 | ||
10 | } IconSuffix; | ||
11 | |||
12 | |||
13 | @@ -1743,6 +1744,8 @@ | ||
14 | return ".svg"; | ||
15 | case ICON_SUFFIX_PNG: | ||
16 | return ".png"; | ||
17 | + case ICON_SUFFIX_ANI: | ||
18 | + return ".ani"; | ||
19 | default: | ||
20 | g_assert_not_reached(); | ||
21 | } | ||
22 | @@ -1760,6 +1763,8 @@ | ||
23 | retval = ICON_SUFFIX_SVG; | ||
24 | else if (g_str_has_suffix (name, ".xpm")) | ||
25 | retval = ICON_SUFFIX_XPM; | ||
26 | + else if (g_str_has_suffix (name, ".ani")) | ||
27 | + retval = ICON_SUFFIX_ANI; | ||
28 | else | ||
29 | retval = ICON_SUFFIX_NONE; | ||
30 | |||
31 | @@ -1776,6 +1781,8 @@ | ||
32 | return ICON_SUFFIX_SVG; | ||
33 | else if ((suffix & ICON_SUFFIX_XPM) != 0) | ||
34 | return ICON_SUFFIX_XPM; | ||
35 | + else if ((suffix & ICON_SUFFIX_ANI) != 0) | ||
36 | + return ICON_SUFFIX_ANI; | ||
37 | else | ||
38 | return ICON_SUFFIX_NONE; | ||
39 | } | ||
40 | @@ -2558,7 +2565,7 @@ | ||
41 | icon_info->pixbuf = gdk_pixbuf_scale_simple (source_pixbuf, | ||
42 | 0.5 + image_width * icon_info->scale, | ||
43 | 0.5 + image_height * icon_info->scale, | ||
44 | - GDK_INTERP_BILINEAR); | ||
45 | + GDK_INTERP_NEAREST); | ||
46 | g_object_unref (source_pixbuf); | ||
47 | } | ||
48 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimcontext.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimcontext.c.diff deleted file mode 100644 index 03d990c6dd..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimcontext.c.diff +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkimcontext.c 2004-09-26 07:23:56.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkimcontext.c 2005-04-06 16:19:36.814941640 +0300 | ||
3 | @@ -360,6 +360,44 @@ | ||
4 | } | ||
5 | |||
6 | /** | ||
7 | + * gtk_im_context_show: | ||
8 | + * @context: a #GtkIMContext | ||
9 | + * | ||
10 | + * Notify the input method that widget thinks the actual | ||
11 | + * input method show be opened. | ||
12 | + **/ | ||
13 | +void | ||
14 | +gtk_im_context_show (GtkIMContext *context) | ||
15 | +{ | ||
16 | + GtkIMContextClass *klass; | ||
17 | + | ||
18 | + g_return_if_fail (GTK_IS_IM_CONTEXT (context)); | ||
19 | + | ||
20 | + klass = GTK_IM_CONTEXT_GET_CLASS (context); | ||
21 | + if (klass->show) | ||
22 | + klass->show (context); | ||
23 | +} | ||
24 | + | ||
25 | +/** | ||
26 | + * gtk_im_context_hide: | ||
27 | + * @context: a #GtkIMContext | ||
28 | + * | ||
29 | + * Notify the input method that widget thinks the actual | ||
30 | + * input method show be closed. | ||
31 | + **/ | ||
32 | +void | ||
33 | +gtk_im_context_hide (GtkIMContext *context) | ||
34 | +{ | ||
35 | + GtkIMContextClass *klass; | ||
36 | + | ||
37 | + g_return_if_fail (GTK_IS_IM_CONTEXT (context)); | ||
38 | + | ||
39 | + klass = GTK_IM_CONTEXT_GET_CLASS (context); | ||
40 | + if (klass->hide) | ||
41 | + klass->hide (context); | ||
42 | +} | ||
43 | + | ||
44 | +/** | ||
45 | * gtk_im_context_reset: | ||
46 | * @context: a #GtkIMContext | ||
47 | * | ||
48 | @@ -553,4 +591,3 @@ | ||
49 | |||
50 | return result; | ||
51 | } | ||
52 | - | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimcontext.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimcontext.h.diff deleted file mode 100644 index 068d18a7d3..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimcontext.h.diff +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkimcontext.h 2002-10-11 01:18:36.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkimcontext.h 2005-04-06 16:19:36.815941488 +0300 | ||
3 | @@ -85,14 +85,15 @@ | ||
4 | gboolean (*get_surrounding) (GtkIMContext *context, | ||
5 | gchar **text, | ||
6 | gint *cursor_index); | ||
7 | + void (*show) (GtkIMContext *context); | ||
8 | + void (*hide) (GtkIMContext *context); | ||
9 | + | ||
10 | |||
11 | /* Padding for future expansion */ | ||
12 | void (*_gtk_reserved1) (void); | ||
13 | void (*_gtk_reserved2) (void); | ||
14 | void (*_gtk_reserved3) (void); | ||
15 | void (*_gtk_reserved4) (void); | ||
16 | - void (*_gtk_reserved5) (void); | ||
17 | - void (*_gtk_reserved6) (void); | ||
18 | }; | ||
19 | |||
20 | GType gtk_im_context_get_type (void) G_GNUC_CONST; | ||
21 | @@ -122,6 +123,8 @@ | ||
22 | gboolean gtk_im_context_delete_surrounding (GtkIMContext *context, | ||
23 | gint offset, | ||
24 | gint n_chars); | ||
25 | +void gtk_im_context_show (GtkIMContext *context); | ||
26 | +void gtk_im_context_hide (GtkIMContext *context); | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimmulticontext.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimmulticontext.c.diff deleted file mode 100644 index 4332a9c318..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkimmulticontext.c.diff +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkimmulticontext.c 2004-08-09 19:59:52.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkimmulticontext.c 2005-04-06 16:19:36.818941032 +0300 | ||
3 | @@ -59,6 +59,8 @@ | ||
4 | static void gtk_im_multicontext_focus_in (GtkIMContext *context); | ||
5 | static void gtk_im_multicontext_focus_out (GtkIMContext *context); | ||
6 | static void gtk_im_multicontext_reset (GtkIMContext *context); | ||
7 | +static void gtk_im_multicontext_show (GtkIMContext *context); | ||
8 | +static void gtk_im_multicontext_hide (GtkIMContext *context); | ||
9 | static void gtk_im_multicontext_set_cursor_location (GtkIMContext *context, | ||
10 | GdkRectangle *area); | ||
11 | static void gtk_im_multicontext_set_use_preedit (GtkIMContext *context, | ||
12 | @@ -118,6 +120,67 @@ | ||
13 | return im_multicontext_type; | ||
14 | } | ||
15 | |||
16 | +static GtkIMContext * | ||
17 | +gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext); | ||
18 | + | ||
19 | +enum { | ||
20 | + PROP_INPUT_MODE = 1, | ||
21 | + PROP_AUTOCAP, | ||
22 | + PROP_VISIBILITY, | ||
23 | + PROP_USE_SHOW_HIDE | ||
24 | +}; | ||
25 | + | ||
26 | +static void gtk_im_multicontext_set_property(GObject * object, | ||
27 | + guint property_id, | ||
28 | + const GValue * value, | ||
29 | + GParamSpec * pspec) | ||
30 | +{ | ||
31 | + GtkIMContext *slave = gtk_im_multicontext_get_slave (GTK_IM_MULTICONTEXT(object)); | ||
32 | + | ||
33 | + GParamSpec *param_spec = g_object_class_find_property | ||
34 | + (G_OBJECT_GET_CLASS(slave), | ||
35 | + pspec->name); | ||
36 | + | ||
37 | + if(param_spec != NULL) | ||
38 | + g_object_set_property(G_OBJECT(slave), pspec->name, value); | ||
39 | +} | ||
40 | + | ||
41 | +static void gtk_im_multicontext_get_property(GObject * object, | ||
42 | + guint property_id, | ||
43 | + GValue * value, | ||
44 | + GParamSpec * pspec) | ||
45 | +{ | ||
46 | + GtkIMContext *slave = gtk_im_multicontext_get_slave (GTK_IM_MULTICONTEXT(object)); | ||
47 | + GParamSpec *param_spec = g_object_class_find_property | ||
48 | + (G_OBJECT_GET_CLASS(slave), | ||
49 | + pspec->name); | ||
50 | + | ||
51 | + if(param_spec != NULL) | ||
52 | + g_object_get_property(G_OBJECT(slave), pspec->name, value); | ||
53 | + else | ||
54 | + { | ||
55 | + switch (property_id) | ||
56 | + { | ||
57 | + case PROP_INPUT_MODE: | ||
58 | + /* return 0 */ | ||
59 | + g_value_set_int(value, 0); | ||
60 | + break; | ||
61 | + case PROP_AUTOCAP: | ||
62 | + /* return FALSE */ | ||
63 | + g_value_set_boolean(value, FALSE); | ||
64 | + break; | ||
65 | + case PROP_VISIBILITY: | ||
66 | + /* return TRUE */ | ||
67 | + g_value_set_boolean(value, TRUE); | ||
68 | + break; | ||
69 | + case PROP_USE_SHOW_HIDE: | ||
70 | + default: | ||
71 | + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); | ||
72 | + break; | ||
73 | + } | ||
74 | + } | ||
75 | +} | ||
76 | + | ||
77 | static void | ||
78 | gtk_im_multicontext_class_init (GtkIMMulticontextClass *class) | ||
79 | { | ||
80 | @@ -132,12 +195,38 @@ | ||
81 | im_context_class->focus_in = gtk_im_multicontext_focus_in; | ||
82 | im_context_class->focus_out = gtk_im_multicontext_focus_out; | ||
83 | im_context_class->reset = gtk_im_multicontext_reset; | ||
84 | + im_context_class->show = gtk_im_multicontext_show; | ||
85 | + im_context_class->hide = gtk_im_multicontext_hide; | ||
86 | im_context_class->set_cursor_location = gtk_im_multicontext_set_cursor_location; | ||
87 | im_context_class->set_use_preedit = gtk_im_multicontext_set_use_preedit; | ||
88 | im_context_class->set_surrounding = gtk_im_multicontext_set_surrounding; | ||
89 | im_context_class->get_surrounding = gtk_im_multicontext_get_surrounding; | ||
90 | |||
91 | gobject_class->finalize = gtk_im_multicontext_finalize; | ||
92 | + | ||
93 | + gobject_class->set_property = gtk_im_multicontext_set_property; | ||
94 | + gobject_class->get_property = gtk_im_multicontext_get_property; | ||
95 | + | ||
96 | + g_object_class_install_property(gobject_class, PROP_INPUT_MODE, | ||
97 | + g_param_spec_int("input-mode", "Input mode", | ||
98 | + "Specifies the set of allowed characters", | ||
99 | + 0, 9, 0, /* We don't move symbolic definitions here. See hildon-input-mode.h */ | ||
100 | + G_PARAM_READWRITE)); | ||
101 | + | ||
102 | + g_object_class_install_property(gobject_class, PROP_AUTOCAP, | ||
103 | + g_param_spec_boolean("autocap", "Autocap", | ||
104 | + "Whether the client wants the first character in a sentense to be automatic upper case", | ||
105 | + FALSE, G_PARAM_READWRITE)); | ||
106 | + | ||
107 | + g_object_class_install_property(gobject_class, PROP_VISIBILITY, | ||
108 | + g_param_spec_boolean("visibility", "Visibility", | ||
109 | + "FALSE displays the \"invisible char\"instead of the actual text (password mode)", | ||
110 | + TRUE, G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
111 | + | ||
112 | + g_object_class_install_property(gobject_class, PROP_VISIBILITY, | ||
113 | + g_param_spec_boolean("use-show-hide", "Use show/hide functions", | ||
114 | + "Use show/hide functions to show/hide IM instead of focus_in/focus_out", | ||
115 | + FALSE, G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
116 | } | ||
117 | |||
118 | static void | ||
119 | @@ -567,3 +656,36 @@ | ||
120 | g_free (contexts); | ||
121 | } | ||
122 | |||
123 | +static void | ||
124 | +gtk_im_multicontext_show (GtkIMContext *context) | ||
125 | +{ | ||
126 | + GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context); | ||
127 | + GtkIMContext *slave; | ||
128 | + | ||
129 | + /* If the global context type is different from the context we were | ||
130 | + * using before, get rid of the old slave and create a new one | ||
131 | + * for the new global context type. | ||
132 | + */ | ||
133 | + if (!multicontext->context_id || | ||
134 | + strcmp (global_context_id, multicontext->context_id) != 0) | ||
135 | + gtk_im_multicontext_set_slave (multicontext, NULL, FALSE); | ||
136 | + | ||
137 | + slave = gtk_im_multicontext_get_slave (multicontext); | ||
138 | + | ||
139 | + multicontext->priv->focus_in = TRUE; | ||
140 | + | ||
141 | + if (slave) | ||
142 | + gtk_im_context_show (slave); | ||
143 | +} | ||
144 | + | ||
145 | +static void | ||
146 | +gtk_im_multicontext_hide (GtkIMContext *context) | ||
147 | +{ | ||
148 | + GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context); | ||
149 | + GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext); | ||
150 | + | ||
151 | + multicontext->priv->focus_in = FALSE; | ||
152 | + | ||
153 | + if (slave) | ||
154 | + gtk_im_context_hide (slave); | ||
155 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel-resize-patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel-resize-patch deleted file mode 100644 index df29656343..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel-resize-patch +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --- gtk+-2.4.3/gtk/gtklabel.c~ 2004-06-11 13:50:34.000000000 +0100 | ||
2 | +++ gtk+-2.4.3/gtk/gtklabel.c 2004-07-05 13:33:57.000000000 +0100 | ||
3 | @@ -1623,6 +1623,7 @@ | ||
4 | |||
5 | /* We have to clear the layout, fonts etc. may have changed */ | ||
6 | gtk_label_clear_layout (label); | ||
7 | + gtk_widget_queue_resize (GTK_WIDGET (label)); | ||
8 | } | ||
9 | |||
10 | static void | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel.c.diff deleted file mode 100644 index e730b66b7f..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel.c.diff +++ /dev/null | |||
@@ -1,390 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtklabel.c 2005-02-28 06:32:03.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtklabel.c 2005-04-06 16:19:36.878931912 +0300 | ||
3 | @@ -23,6 +23,11 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | + | ||
8 | +/* Modified for Nokia Oyj during 2004. See CHANGES file for list | ||
9 | + * of changes. | ||
10 | + */ | ||
11 | + | ||
12 | #include <config.h> | ||
13 | #include <math.h> | ||
14 | #include <string.h> | ||
15 | @@ -52,6 +57,7 @@ | ||
16 | guint single_line_mode : 1; | ||
17 | guint have_transform : 1; | ||
18 | gdouble angle; | ||
19 | + gboolean request_full_width; | ||
20 | } | ||
21 | GtkLabelPrivate; | ||
22 | |||
23 | @@ -75,6 +81,9 @@ | ||
24 | LAST_SIGNAL | ||
25 | }; | ||
26 | |||
27 | +/* Hildon mod. | ||
28 | + A property PROP_TRANSLATABLE has been added here. If new Gtk+ | ||
29 | + versions add items here, the compability will break. */ | ||
30 | enum { | ||
31 | PROP_0, | ||
32 | PROP_LABEL, | ||
33 | @@ -89,6 +98,7 @@ | ||
34 | PROP_MNEMONIC_WIDGET, | ||
35 | PROP_CURSOR_POSITION, | ||
36 | PROP_SELECTION_BOUND, | ||
37 | + PROP_TRANSLATABLE, | ||
38 | PROP_ELLIPSIZE, | ||
39 | PROP_WIDTH_CHARS, | ||
40 | PROP_SINGLE_LINE_MODE, | ||
41 | @@ -96,6 +106,12 @@ | ||
42 | PROP_MAX_WIDTH_CHARS | ||
43 | }; | ||
44 | |||
45 | +/* Hildon mod. A few keys. These are used to store data for label | ||
46 | + * without changing the private structures. */ | ||
47 | +#define LABEL_KEY_TRANSLATABLE "label_translatable" | ||
48 | +#define LABEL_KEY_TRANSLATABLETEXT "label_translatabletext" | ||
49 | +#define LABEL_KEY_ORIGINAL_LAYOUT "label_original_layout" | ||
50 | + | ||
51 | static guint signals[LAST_SIGNAL] = { 0 }; | ||
52 | |||
53 | static void gtk_label_class_init (GtkLabelClass *klass); | ||
54 | @@ -149,7 +165,7 @@ | ||
55 | static void gtk_label_set_uline_text_internal (GtkLabel *label, | ||
56 | const gchar *str); | ||
57 | static void gtk_label_set_pattern_internal (GtkLabel *label, | ||
58 | - const gchar *pattern); | ||
59 | + const gchar *pattern); | ||
60 | static void set_markup (GtkLabel *label, | ||
61 | const gchar *str, | ||
62 | gboolean with_uline); | ||
63 | @@ -516,6 +532,24 @@ | ||
64 | G_MAXINT, | ||
65 | -1, | ||
66 | G_PARAM_READWRITE)); | ||
67 | + /* Hildon mod. Add property for a widget - whether it supports run-time | ||
68 | + + locale change. Please note that this functionality is not yet | ||
69 | + + completed and may change. */ | ||
70 | + g_object_class_install_property (gobject_class, | ||
71 | + PROP_TRANSLATABLE, | ||
72 | + g_param_spec_boolean ("translatable", | ||
73 | + _("Is translatable"), | ||
74 | + _("Whether label should be translatable."), | ||
75 | + FALSE, | ||
76 | + G_PARAM_READWRITE)); | ||
77 | + | ||
78 | + /* Hildonlike class property */ | ||
79 | + gtk_widget_class_install_style_property (widget_class, | ||
80 | + g_param_spec_boolean ("hildonlike", | ||
81 | + _("hildonlike looks"), | ||
82 | + _("Changes wrapping etc behaviour, 1/0"), | ||
83 | + FALSE, | ||
84 | + G_PARAM_READABLE)); | ||
85 | /* | ||
86 | * Key bindings | ||
87 | */ | ||
88 | @@ -650,6 +684,10 @@ | ||
89 | case PROP_MAX_WIDTH_CHARS: | ||
90 | gtk_label_set_max_width_chars (label, g_value_get_int (value)); | ||
91 | break; | ||
92 | +/* Hildon add. */ | ||
93 | + case PROP_TRANSLATABLE: | ||
94 | + gtk_label_set_translatable (label, g_value_get_boolean (value)); | ||
95 | + break; | ||
96 | default: | ||
97 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
98 | break; | ||
99 | @@ -730,6 +768,10 @@ | ||
100 | case PROP_MAX_WIDTH_CHARS: | ||
101 | g_value_set_int (value, gtk_label_get_max_width_chars (label)); | ||
102 | break; | ||
103 | +/* Hildon mod. */ | ||
104 | + case PROP_TRANSLATABLE: | ||
105 | + g_value_set_boolean (value, gtk_label_get_translatable (label)); | ||
106 | + break; | ||
107 | |||
108 | default: | ||
109 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
110 | @@ -748,6 +790,7 @@ | ||
111 | priv->width_chars = -1; | ||
112 | priv->angle = 0.0; | ||
113 | priv->max_width_chars = -1; | ||
114 | + priv->request_full_width = FALSE; | ||
115 | label->label = NULL; | ||
116 | |||
117 | label->jtype = GTK_JUSTIFY_LEFT; | ||
118 | @@ -766,6 +809,15 @@ | ||
119 | label->mnemonic_window = NULL; | ||
120 | |||
121 | gtk_label_set_text (label, ""); | ||
122 | + | ||
123 | +/* Hildon Addition. */ | ||
124 | + | ||
125 | + g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLE, FALSE); | ||
126 | + g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT, NULL); | ||
127 | + g_object_set_data (G_OBJECT (label), LABEL_KEY_ORIGINAL_LAYOUT, NULL); | ||
128 | + | ||
129 | +/* /Hildon Addition. */ | ||
130 | + | ||
131 | } | ||
132 | |||
133 | /** | ||
134 | @@ -822,7 +874,7 @@ | ||
135 | |||
136 | if (str && *str) | ||
137 | gtk_label_set_text_with_mnemonic (label, str); | ||
138 | - | ||
139 | + | ||
140 | return GTK_WIDGET (label); | ||
141 | } | ||
142 | |||
143 | @@ -1257,7 +1309,7 @@ | ||
144 | GError *error = NULL; | ||
145 | PangoAttrList *attrs = NULL; | ||
146 | gunichar accel_char = 0; | ||
147 | - | ||
148 | + | ||
149 | if (!pango_parse_markup (str, | ||
150 | -1, | ||
151 | with_uline ? '_' : 0, | ||
152 | @@ -1340,12 +1392,14 @@ | ||
153 | g_return_if_fail (GTK_IS_LABEL (label)); | ||
154 | |||
155 | last_keyval = label->mnemonic_keyval; | ||
156 | + | ||
157 | gtk_label_set_label_internal (label, g_strdup (str ? str : "")); | ||
158 | gtk_label_set_use_markup_internal (label, TRUE); | ||
159 | gtk_label_set_use_underline_internal (label, TRUE); | ||
160 | - | ||
161 | gtk_label_recalculate (label); | ||
162 | + | ||
163 | gtk_label_setup_mnemonic (label, last_keyval); | ||
164 | + | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | @@ -1409,7 +1463,7 @@ | ||
169 | |||
170 | static void | ||
171 | gtk_label_set_pattern_internal (GtkLabel *label, | ||
172 | - const gchar *pattern) | ||
173 | + const gchar *pattern) | ||
174 | { | ||
175 | PangoAttrList *attrs; | ||
176 | g_return_if_fail (GTK_IS_LABEL (label)); | ||
177 | @@ -1421,7 +1475,16 @@ | ||
178 | |||
179 | if (label->effective_attrs) | ||
180 | pango_attr_list_unref (label->effective_attrs); | ||
181 | +/* Following will disable undercores from | ||
182 | + keyboard shortcuts if DISABLE_KEYBOARD_SHORTCUTS | ||
183 | + is enabled during compile time | ||
184 | + */ | ||
185 | +#ifndef DISABLE_KEYBOARD_SHORTCUTS | ||
186 | label->effective_attrs = attrs; | ||
187 | +#else | ||
188 | + pango_attr_list_unref (attrs); | ||
189 | +#endif /* DISABLE_KEYBOARD_SHORTCUTS */ | ||
190 | + | ||
191 | } | ||
192 | |||
193 | void | ||
194 | @@ -1742,8 +1805,13 @@ | ||
195 | { | ||
196 | PangoLayout *layout; | ||
197 | GtkStyle *style = GTK_WIDGET (label)->style; | ||
198 | - | ||
199 | + | ||
200 | + gboolean hildonlike; | ||
201 | LabelWrapWidth *wrap_width = g_object_get_data (G_OBJECT (style), "gtk-label-wrap-width"); | ||
202 | + | ||
203 | + /* Hildon: get hildonlike property */ | ||
204 | + gtk_widget_style_get (GTK_WIDGET (label), "hildonlike", &hildonlike, NULL); | ||
205 | + | ||
206 | if (!wrap_width) | ||
207 | { | ||
208 | wrap_width = g_new0 (LabelWrapWidth, 1); | ||
209 | @@ -1763,7 +1831,12 @@ | ||
210 | "This long string gives a good enough length for any line to have."); | ||
211 | pango_layout_get_size (layout, &wrap_width->width, NULL); | ||
212 | g_object_unref (layout); | ||
213 | - | ||
214 | + /* A hildon mod for "fixing line wrapping". Remember to remove this | ||
215 | + when GtkLabel will implement width for height size negotiation.*/ | ||
216 | + if (hildonlike) | ||
217 | + { | ||
218 | + wrap_width->width = wrap_width->width * 1.25; | ||
219 | + } | ||
220 | return wrap_width->width; | ||
221 | } | ||
222 | |||
223 | @@ -1774,8 +1847,12 @@ | ||
224 | PangoRectangle logical_rect; | ||
225 | gint rwidth, rheight; | ||
226 | gboolean rtl; | ||
227 | + gboolean hildonlike; | ||
228 | |||
229 | widget = GTK_WIDGET (label); | ||
230 | + | ||
231 | + /* Hildon: get hildonlike property */ | ||
232 | + gtk_widget_style_get (widget, "hildonlike", &hildonlike, NULL); | ||
233 | |||
234 | rtl = gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL; | ||
235 | rwidth = label->misc.xpad * 2; | ||
236 | @@ -1864,8 +1941,18 @@ | ||
237 | |||
238 | wrap_width = get_label_wrap_width (label); | ||
239 | width = MIN (width, wrap_width); | ||
240 | - width = MIN (width, | ||
241 | + | ||
242 | + if (!hildonlike) | ||
243 | + { | ||
244 | + width = MIN (width, | ||
245 | PANGO_SCALE * (gdk_screen_get_width (screen) + 1) / 2); | ||
246 | + } | ||
247 | + else | ||
248 | + { | ||
249 | + width = MIN (width, | ||
250 | + PANGO_SCALE * (gdk_screen_get_width (screen) + 1)); | ||
251 | + } | ||
252 | + | ||
253 | |||
254 | pango_layout_set_width (label->layout, width); | ||
255 | pango_layout_get_extents (label->layout, NULL, &logical_rect); | ||
256 | @@ -1910,6 +1997,7 @@ | ||
257 | else /* !label->wrap */ | ||
258 | pango_layout_set_width (label->layout, -1); | ||
259 | } | ||
260 | + | ||
261 | } | ||
262 | |||
263 | /* Gets the bounds of a layout in device coordinates. Note cut-and-paste | ||
264 | @@ -2017,7 +2105,8 @@ | ||
265 | priv->width_chars > 0 || priv->max_width_chars > 0) && | ||
266 | aux_info && aux_info->width > 0) | ||
267 | width += aux_info->width; | ||
268 | - else if (label->ellipsize || priv->width_chars > 0 || priv->max_width_chars > 0) | ||
269 | + else if ((label->ellipsize || priv->width_chars > 0 || priv->max_width_chars > 0) && | ||
270 | + !priv->request_full_width) | ||
271 | { | ||
272 | PangoContext *context; | ||
273 | PangoFontMetrics *metrics; | ||
274 | @@ -2081,11 +2170,24 @@ | ||
275 | GtkAllocation *allocation) | ||
276 | { | ||
277 | GtkLabel *label; | ||
278 | + GtkRequisition req; | ||
279 | + GtkLabelPrivate *priv; | ||
280 | |||
281 | label = GTK_LABEL (widget); | ||
282 | + priv = GTK_LABEL_GET_PRIVATE (label); | ||
283 | |||
284 | (* GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation); | ||
285 | |||
286 | + gtk_widget_get_child_requisition (widget, &req); | ||
287 | + | ||
288 | + if (allocation->width < req.width && !label->wrap) | ||
289 | + { | ||
290 | + gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END); | ||
291 | + priv->request_full_width = TRUE; | ||
292 | + } | ||
293 | + else | ||
294 | + priv->request_full_width = FALSE; | ||
295 | + | ||
296 | if (label->ellipsize) | ||
297 | { | ||
298 | if (label->layout) | ||
299 | @@ -2479,7 +2581,7 @@ | ||
300 | } | ||
301 | *dest = 0; | ||
302 | *pattern_dest = 0; | ||
303 | - | ||
304 | + | ||
305 | gtk_label_set_text_internal (label, new_str); | ||
306 | gtk_label_set_pattern_internal (label, pattern); | ||
307 | |||
308 | @@ -2541,13 +2643,11 @@ | ||
309 | last_keyval = label->mnemonic_keyval; | ||
310 | |||
311 | g_object_freeze_notify (G_OBJECT (label)); | ||
312 | - | ||
313 | gtk_label_set_label_internal (label, g_strdup (str ? str : "")); | ||
314 | gtk_label_set_use_markup_internal (label, FALSE); | ||
315 | gtk_label_set_use_underline_internal (label, TRUE); | ||
316 | - | ||
317 | - gtk_label_recalculate (label); | ||
318 | |||
319 | + gtk_label_recalculate (label); | ||
320 | gtk_label_setup_mnemonic (label, last_keyval); | ||
321 | |||
322 | g_object_thaw_notify (G_OBJECT (label)); | ||
323 | @@ -3948,3 +4048,67 @@ | ||
324 | popup_position_func, label, | ||
325 | 0, gtk_get_current_event_time ()); | ||
326 | } | ||
327 | + | ||
328 | +/* Hildon mod. | ||
329 | + * Functions for run-time locale changing. Beware though that this | ||
330 | + functionality is not yet completed. Therefore it's suggested | ||
331 | + that these functions shouldn't be used yet outside testing. */ | ||
332 | + | ||
333 | +void gtk_label_set_translatable (GtkLabel *label, gboolean newstatus) | ||
334 | +{ | ||
335 | + if (newstatus == gtk_label_get_translatable (label)) return; | ||
336 | + | ||
337 | + if (newstatus == TRUE) | ||
338 | + { | ||
339 | + if (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT) != NULL) | ||
340 | + g_free (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT)); | ||
341 | + g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT, g_strdup (label->label)); | ||
342 | + g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLE, (void*) TRUE); | ||
343 | + if (label->text != NULL) | ||
344 | + g_free (label->text); | ||
345 | + if (label->label != NULL) | ||
346 | + g_free (label->label); | ||
347 | + label->text = g_strdup(_(g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT))); | ||
348 | + label->label = g_strdup(_(g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT))); | ||
349 | + } | ||
350 | + else | ||
351 | + { | ||
352 | + if (label->text != NULL) | ||
353 | + g_free (label->text); | ||
354 | + if (label->label != NULL) | ||
355 | + g_free (label->label); | ||
356 | + label->text = g_strdup (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT)); | ||
357 | + label->label = g_strdup (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT)); | ||
358 | + g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLE, FALSE); | ||
359 | + if (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT) != NULL) | ||
360 | + g_free (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT)); | ||
361 | + g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT, NULL); | ||
362 | + } | ||
363 | + gtk_label_recalculate (label); | ||
364 | +} | ||
365 | + | ||
366 | +gboolean gtk_label_get_translatable (GtkLabel *label) | ||
367 | +{ | ||
368 | + return (gboolean) (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLE)); | ||
369 | +} | ||
370 | + | ||
371 | + | ||
372 | +void gtk_label_retranslate (GtkLabel *label) | ||
373 | +{ | ||
374 | + g_object_freeze_notify (G_OBJECT (label)); | ||
375 | + if (gtk_label_get_translatable (label) == TRUE) | ||
376 | + { | ||
377 | + if (label->label != NULL) | ||
378 | + g_free (label->label); | ||
379 | + label->label = g_strdup(gettext(g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT))); | ||
380 | + } | ||
381 | + if (g_object_get_data (G_OBJECT (label), LABEL_KEY_ORIGINAL_LAYOUT)) g_object_unref (g_object_get_data (G_OBJECT (label), LABEL_KEY_ORIGINAL_LAYOUT)); | ||
382 | + g_object_set_data (G_OBJECT (label), LABEL_KEY_ORIGINAL_LAYOUT, NULL); | ||
383 | + g_object_notify (G_OBJECT (label), "label"); | ||
384 | + gtk_label_recalculate (label); | ||
385 | + g_object_thaw_notify (G_OBJECT (label)); | ||
386 | + gtk_label_set_text (label, label->label); | ||
387 | +} | ||
388 | + | ||
389 | +/* End of hildon mods for run-time locale change. */ | ||
390 | + | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel.h.diff deleted file mode 100644 index 5aef5e5a62..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtklabel.h.diff +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtklabel.h 2004-12-13 08:34:54.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtklabel.h 2005-04-06 16:19:36.889930240 +0300 | ||
3 | @@ -23,6 +23,10 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2004. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | #ifndef __GTK_LABEL_H__ | ||
12 | #define __GTK_LABEL_H__ | ||
13 | |||
14 | @@ -165,6 +169,15 @@ | ||
15 | gboolean single_line_mode); | ||
16 | gboolean gtk_label_get_single_line_mode (GtkLabel *label); | ||
17 | |||
18 | +/* Additional Hildon functions for run-time locale change */ | ||
19 | + | ||
20 | +void gtk_label_set_translatable (GtkLabel *label, gboolean newstatus); | ||
21 | +gboolean gtk_label_get_translatable (GtkLabel *label); | ||
22 | + | ||
23 | +void gtk_label_retranslate (GtkLabel *label); | ||
24 | + | ||
25 | +/* ----- */ | ||
26 | + | ||
27 | #ifndef GTK_DISABLE_DEPRECATED | ||
28 | |||
29 | #define gtk_label_set gtk_label_set_text | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmain.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmain.c.diff deleted file mode 100644 index 2132487bdf..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmain.c.diff +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmain.c 2004-12-27 07:25:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmain.c 2005-04-06 16:19:36.897929024 +0300 | ||
3 | @@ -68,6 +68,7 @@ | ||
4 | #include "gtkwindow.h" | ||
5 | #include "gtkprivate.h" | ||
6 | #include "gtkdebug.h" | ||
7 | +#include "gtkwidget.h" | ||
8 | |||
9 | /* Private type definitions | ||
10 | */ | ||
11 | @@ -1297,6 +1298,15 @@ | ||
12 | { | ||
13 | grab_widget = event_widget; | ||
14 | } | ||
15 | + | ||
16 | + /* Hildon: insensitive press handling is moved here */ | ||
17 | + if (event->type == GDK_BUTTON_PRESS) | ||
18 | + { | ||
19 | + if (!GTK_WIDGET_IS_SENSITIVE (event_widget)) | ||
20 | + { | ||
21 | + gtk_widget_insensitive_press(event_widget); | ||
22 | + } | ||
23 | + } | ||
24 | |||
25 | /* Not all events get sent to the grabbing widget. | ||
26 | * The delete, destroy, expose, focus change and resize | ||
27 | @@ -2090,7 +2100,7 @@ | ||
28 | handled_event = FALSE; | ||
29 | |||
30 | g_object_ref (widget); | ||
31 | - | ||
32 | + | ||
33 | if ((event->type == GDK_KEY_PRESS) || | ||
34 | (event->type == GDK_KEY_RELEASE)) | ||
35 | { | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshal.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshal.c.diff deleted file mode 100644 index 80c0618bf9..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshal.c.diff +++ /dev/null | |||
@@ -1,266 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmarshal.c 2005-03-01 17:58:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmarshal.c 2005-04-06 16:19:36.898928872 +0300 | ||
3 | @@ -48,7 +48,7 @@ | ||
4 | #endif /* !G_ENABLE_DEBUG */ | ||
5 | |||
6 | |||
7 | -/* BOOL:NONE (./gtkmarshal.list:1) */ | ||
8 | +/* BOOL:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:1) */ | ||
9 | void | ||
10 | gtk_marshal_BOOLEAN__VOID (GClosure *closure, | ||
11 | GValue *return_value, | ||
12 | @@ -85,7 +85,7 @@ | ||
13 | g_value_set_boolean (return_value, v_return); | ||
14 | } | ||
15 | |||
16 | -/* BOOL:POINTER (./gtkmarshal.list:2) */ | ||
17 | +/* BOOL:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:2) */ | ||
18 | void | ||
19 | gtk_marshal_BOOLEAN__POINTER (GClosure *closure, | ||
20 | GValue *return_value, | ||
21 | @@ -124,7 +124,7 @@ | ||
22 | g_value_set_boolean (return_value, v_return); | ||
23 | } | ||
24 | |||
25 | -/* BOOL:POINTER,POINTER,INT,INT (./gtkmarshal.list:3) */ | ||
26 | +/* BOOL:POINTER,POINTER,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:3) */ | ||
27 | void | ||
28 | gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT (GClosure *closure, | ||
29 | GValue *return_value, | ||
30 | @@ -169,7 +169,7 @@ | ||
31 | g_value_set_boolean (return_value, v_return); | ||
32 | } | ||
33 | |||
34 | -/* BOOL:POINTER,INT,INT (./gtkmarshal.list:4) */ | ||
35 | +/* BOOL:POINTER,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:4) */ | ||
36 | void | ||
37 | gtk_marshal_BOOLEAN__POINTER_INT_INT (GClosure *closure, | ||
38 | GValue *return_value, | ||
39 | @@ -212,7 +212,7 @@ | ||
40 | g_value_set_boolean (return_value, v_return); | ||
41 | } | ||
42 | |||
43 | -/* BOOL:POINTER,INT,INT,UINT (./gtkmarshal.list:5) */ | ||
44 | +/* BOOL:POINTER,INT,INT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:5) */ | ||
45 | void | ||
46 | gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT (GClosure *closure, | ||
47 | GValue *return_value, | ||
48 | @@ -257,7 +257,7 @@ | ||
49 | g_value_set_boolean (return_value, v_return); | ||
50 | } | ||
51 | |||
52 | -/* BOOL:POINTER,STRING,STRING,POINTER (./gtkmarshal.list:6) */ | ||
53 | +/* BOOL:POINTER,STRING,STRING,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:6) */ | ||
54 | void | ||
55 | gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER (GClosure *closure, | ||
56 | GValue *return_value, | ||
57 | @@ -302,7 +302,7 @@ | ||
58 | g_value_set_boolean (return_value, v_return); | ||
59 | } | ||
60 | |||
61 | -/* ENUM:ENUM (./gtkmarshal.list:7) */ | ||
62 | +/* ENUM:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:7) */ | ||
63 | void | ||
64 | gtk_marshal_ENUM__ENUM (GClosure *closure, | ||
65 | GValue *return_value, | ||
66 | @@ -341,7 +341,7 @@ | ||
67 | g_value_set_enum (return_value, v_return); | ||
68 | } | ||
69 | |||
70 | -/* INT:POINTER (./gtkmarshal.list:8) */ | ||
71 | +/* INT:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:8) */ | ||
72 | void | ||
73 | gtk_marshal_INT__POINTER (GClosure *closure, | ||
74 | GValue *return_value, | ||
75 | @@ -380,7 +380,7 @@ | ||
76 | g_value_set_int (return_value, v_return); | ||
77 | } | ||
78 | |||
79 | -/* INT:POINTER,CHAR,CHAR (./gtkmarshal.list:9) */ | ||
80 | +/* INT:POINTER,CHAR,CHAR (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:9) */ | ||
81 | void | ||
82 | gtk_marshal_INT__POINTER_CHAR_CHAR (GClosure *closure, | ||
83 | GValue *return_value, | ||
84 | @@ -423,13 +423,13 @@ | ||
85 | g_value_set_int (return_value, v_return); | ||
86 | } | ||
87 | |||
88 | -/* NONE:BOOL (./gtkmarshal.list:10) */ | ||
89 | +/* NONE:BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:10) */ | ||
90 | |||
91 | -/* NONE:BOXED (./gtkmarshal.list:11) */ | ||
92 | +/* NONE:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:11) */ | ||
93 | |||
94 | -/* NONE:ENUM (./gtkmarshal.list:12) */ | ||
95 | +/* NONE:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:12) */ | ||
96 | |||
97 | -/* NONE:ENUM,FLOAT (./gtkmarshal.list:13) */ | ||
98 | +/* NONE:ENUM,FLOAT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:13) */ | ||
99 | void | ||
100 | gtk_marshal_VOID__ENUM_FLOAT (GClosure *closure, | ||
101 | GValue *return_value, | ||
102 | @@ -466,7 +466,7 @@ | ||
103 | data2); | ||
104 | } | ||
105 | |||
106 | -/* NONE:ENUM,FLOAT,BOOL (./gtkmarshal.list:14) */ | ||
107 | +/* NONE:ENUM,FLOAT,BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:14) */ | ||
108 | void | ||
109 | gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure *closure, | ||
110 | GValue *return_value, | ||
111 | @@ -505,9 +505,9 @@ | ||
112 | data2); | ||
113 | } | ||
114 | |||
115 | -/* NONE:INT (./gtkmarshal.list:15) */ | ||
116 | +/* NONE:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:15) */ | ||
117 | |||
118 | -/* NONE:INT,INT (./gtkmarshal.list:16) */ | ||
119 | +/* NONE:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:16) */ | ||
120 | void | ||
121 | gtk_marshal_VOID__INT_INT (GClosure *closure, | ||
122 | GValue *return_value, | ||
123 | @@ -544,7 +544,7 @@ | ||
124 | data2); | ||
125 | } | ||
126 | |||
127 | -/* NONE:INT,INT,POINTER (./gtkmarshal.list:17) */ | ||
128 | +/* NONE:INT,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:17) */ | ||
129 | void | ||
130 | gtk_marshal_VOID__INT_INT_POINTER (GClosure *closure, | ||
131 | GValue *return_value, | ||
132 | @@ -583,13 +583,13 @@ | ||
133 | data2); | ||
134 | } | ||
135 | |||
136 | -/* NONE:NONE (./gtkmarshal.list:18) */ | ||
137 | +/* NONE:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:18) */ | ||
138 | |||
139 | -/* NONE:OBJECT (./gtkmarshal.list:19) */ | ||
140 | +/* NONE:OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:19) */ | ||
141 | |||
142 | -/* NONE:POINTER (./gtkmarshal.list:20) */ | ||
143 | +/* NONE:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:20) */ | ||
144 | |||
145 | -/* NONE:POINTER,INT (./gtkmarshal.list:21) */ | ||
146 | +/* NONE:POINTER,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:21) */ | ||
147 | void | ||
148 | gtk_marshal_VOID__POINTER_INT (GClosure *closure, | ||
149 | GValue *return_value, | ||
150 | @@ -626,7 +626,7 @@ | ||
151 | data2); | ||
152 | } | ||
153 | |||
154 | -/* NONE:POINTER,POINTER (./gtkmarshal.list:22) */ | ||
155 | +/* NONE:POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:22) */ | ||
156 | void | ||
157 | gtk_marshal_VOID__POINTER_POINTER (GClosure *closure, | ||
158 | GValue *return_value, | ||
159 | @@ -663,7 +663,7 @@ | ||
160 | data2); | ||
161 | } | ||
162 | |||
163 | -/* NONE:POINTER,POINTER,POINTER (./gtkmarshal.list:23) */ | ||
164 | +/* NONE:POINTER,POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:23) */ | ||
165 | void | ||
166 | gtk_marshal_VOID__POINTER_POINTER_POINTER (GClosure *closure, | ||
167 | GValue *return_value, | ||
168 | @@ -702,7 +702,7 @@ | ||
169 | data2); | ||
170 | } | ||
171 | |||
172 | -/* NONE:POINTER,STRING,STRING (./gtkmarshal.list:24) */ | ||
173 | +/* NONE:POINTER,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:24) */ | ||
174 | void | ||
175 | gtk_marshal_VOID__POINTER_STRING_STRING (GClosure *closure, | ||
176 | GValue *return_value, | ||
177 | @@ -741,7 +741,7 @@ | ||
178 | data2); | ||
179 | } | ||
180 | |||
181 | -/* NONE:POINTER,UINT (./gtkmarshal.list:25) */ | ||
182 | +/* NONE:POINTER,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:25) */ | ||
183 | void | ||
184 | gtk_marshal_VOID__POINTER_UINT (GClosure *closure, | ||
185 | GValue *return_value, | ||
186 | @@ -778,7 +778,7 @@ | ||
187 | data2); | ||
188 | } | ||
189 | |||
190 | -/* NONE:POINTER,UINT,ENUM (./gtkmarshal.list:26) */ | ||
191 | +/* NONE:POINTER,UINT,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:26) */ | ||
192 | void | ||
193 | gtk_marshal_VOID__POINTER_UINT_ENUM (GClosure *closure, | ||
194 | GValue *return_value, | ||
195 | @@ -817,7 +817,7 @@ | ||
196 | data2); | ||
197 | } | ||
198 | |||
199 | -/* NONE:POINTER,POINTER,UINT,UINT (./gtkmarshal.list:27) */ | ||
200 | +/* NONE:POINTER,POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:27) */ | ||
201 | void | ||
202 | gtk_marshal_VOID__POINTER_POINTER_UINT_UINT (GClosure *closure, | ||
203 | GValue *return_value, | ||
204 | @@ -858,7 +858,7 @@ | ||
205 | data2); | ||
206 | } | ||
207 | |||
208 | -/* NONE:POINTER,INT,INT,POINTER,UINT,UINT (./gtkmarshal.list:28) */ | ||
209 | +/* NONE:POINTER,INT,INT,POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:28) */ | ||
210 | void | ||
211 | gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT (GClosure *closure, | ||
212 | GValue *return_value, | ||
213 | @@ -903,7 +903,7 @@ | ||
214 | data2); | ||
215 | } | ||
216 | |||
217 | -/* NONE:POINTER,UINT,UINT (./gtkmarshal.list:29) */ | ||
218 | +/* NONE:POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:29) */ | ||
219 | void | ||
220 | gtk_marshal_VOID__POINTER_UINT_UINT (GClosure *closure, | ||
221 | GValue *return_value, | ||
222 | @@ -942,11 +942,11 @@ | ||
223 | data2); | ||
224 | } | ||
225 | |||
226 | -/* NONE:POINTER,UINT,UINT (./gtkmarshal.list:30) */ | ||
227 | +/* NONE:POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:30) */ | ||
228 | |||
229 | -/* NONE:STRING (./gtkmarshal.list:31) */ | ||
230 | +/* NONE:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:31) */ | ||
231 | |||
232 | -/* NONE:STRING,INT,POINTER (./gtkmarshal.list:32) */ | ||
233 | +/* NONE:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:32) */ | ||
234 | void | ||
235 | gtk_marshal_VOID__STRING_INT_POINTER (GClosure *closure, | ||
236 | GValue *return_value, | ||
237 | @@ -985,9 +985,9 @@ | ||
238 | data2); | ||
239 | } | ||
240 | |||
241 | -/* NONE:UINT (./gtkmarshal.list:33) */ | ||
242 | +/* NONE:UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:33) */ | ||
243 | |||
244 | -/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (./gtkmarshal.list:34) */ | ||
245 | +/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:34) */ | ||
246 | void | ||
247 | gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER (GClosure *closure, | ||
248 | GValue *return_value, | ||
249 | @@ -1032,7 +1032,7 @@ | ||
250 | data2); | ||
251 | } | ||
252 | |||
253 | -/* NONE:UINT,POINTER,UINT,UINT,ENUM (./gtkmarshal.list:35) */ | ||
254 | +/* NONE:UINT,POINTER,UINT,UINT,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:35) */ | ||
255 | void | ||
256 | gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM (GClosure *closure, | ||
257 | GValue *return_value, | ||
258 | @@ -1075,7 +1075,7 @@ | ||
259 | data2); | ||
260 | } | ||
261 | |||
262 | -/* NONE:UINT,STRING (./gtkmarshal.list:36) */ | ||
263 | +/* NONE:UINT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:36) */ | ||
264 | void | ||
265 | gtk_marshal_VOID__UINT_STRING (GClosure *closure, | ||
266 | GValue *return_value, | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshal.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshal.h.diff deleted file mode 100644 index 9740129005..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshal.h.diff +++ /dev/null | |||
@@ -1,284 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmarshal.h 2005-03-01 17:58:16.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmarshal.h 2005-04-06 16:19:36.899928720 +0300 | ||
3 | @@ -7,7 +7,7 @@ | ||
4 | |||
5 | G_BEGIN_DECLS | ||
6 | |||
7 | -/* BOOL:NONE (./gtkmarshal.list:1) */ | ||
8 | +/* BOOL:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:1) */ | ||
9 | extern void gtk_marshal_BOOLEAN__VOID (GClosure *closure, | ||
10 | GValue *return_value, | ||
11 | guint n_param_values, | ||
12 | @@ -16,7 +16,7 @@ | ||
13 | gpointer marshal_data); | ||
14 | #define gtk_marshal_BOOL__NONE gtk_marshal_BOOLEAN__VOID | ||
15 | |||
16 | -/* BOOL:POINTER (./gtkmarshal.list:2) */ | ||
17 | +/* BOOL:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:2) */ | ||
18 | extern void gtk_marshal_BOOLEAN__POINTER (GClosure *closure, | ||
19 | GValue *return_value, | ||
20 | guint n_param_values, | ||
21 | @@ -25,7 +25,7 @@ | ||
22 | gpointer marshal_data); | ||
23 | #define gtk_marshal_BOOL__POINTER gtk_marshal_BOOLEAN__POINTER | ||
24 | |||
25 | -/* BOOL:POINTER,POINTER,INT,INT (./gtkmarshal.list:3) */ | ||
26 | +/* BOOL:POINTER,POINTER,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:3) */ | ||
27 | extern void gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT (GClosure *closure, | ||
28 | GValue *return_value, | ||
29 | guint n_param_values, | ||
30 | @@ -34,7 +34,7 @@ | ||
31 | gpointer marshal_data); | ||
32 | #define gtk_marshal_BOOL__POINTER_POINTER_INT_INT gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT | ||
33 | |||
34 | -/* BOOL:POINTER,INT,INT (./gtkmarshal.list:4) */ | ||
35 | +/* BOOL:POINTER,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:4) */ | ||
36 | extern void gtk_marshal_BOOLEAN__POINTER_INT_INT (GClosure *closure, | ||
37 | GValue *return_value, | ||
38 | guint n_param_values, | ||
39 | @@ -43,7 +43,7 @@ | ||
40 | gpointer marshal_data); | ||
41 | #define gtk_marshal_BOOL__POINTER_INT_INT gtk_marshal_BOOLEAN__POINTER_INT_INT | ||
42 | |||
43 | -/* BOOL:POINTER,INT,INT,UINT (./gtkmarshal.list:5) */ | ||
44 | +/* BOOL:POINTER,INT,INT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:5) */ | ||
45 | extern void gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT (GClosure *closure, | ||
46 | GValue *return_value, | ||
47 | guint n_param_values, | ||
48 | @@ -52,7 +52,7 @@ | ||
49 | gpointer marshal_data); | ||
50 | #define gtk_marshal_BOOL__POINTER_INT_INT_UINT gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT | ||
51 | |||
52 | -/* BOOL:POINTER,STRING,STRING,POINTER (./gtkmarshal.list:6) */ | ||
53 | +/* BOOL:POINTER,STRING,STRING,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:6) */ | ||
54 | extern void gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER (GClosure *closure, | ||
55 | GValue *return_value, | ||
56 | guint n_param_values, | ||
57 | @@ -61,7 +61,7 @@ | ||
58 | gpointer marshal_data); | ||
59 | #define gtk_marshal_BOOL__POINTER_STRING_STRING_POINTER gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER | ||
60 | |||
61 | -/* ENUM:ENUM (./gtkmarshal.list:7) */ | ||
62 | +/* ENUM:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:7) */ | ||
63 | extern void gtk_marshal_ENUM__ENUM (GClosure *closure, | ||
64 | GValue *return_value, | ||
65 | guint n_param_values, | ||
66 | @@ -69,7 +69,7 @@ | ||
67 | gpointer invocation_hint, | ||
68 | gpointer marshal_data); | ||
69 | |||
70 | -/* INT:POINTER (./gtkmarshal.list:8) */ | ||
71 | +/* INT:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:8) */ | ||
72 | extern void gtk_marshal_INT__POINTER (GClosure *closure, | ||
73 | GValue *return_value, | ||
74 | guint n_param_values, | ||
75 | @@ -77,7 +77,7 @@ | ||
76 | gpointer invocation_hint, | ||
77 | gpointer marshal_data); | ||
78 | |||
79 | -/* INT:POINTER,CHAR,CHAR (./gtkmarshal.list:9) */ | ||
80 | +/* INT:POINTER,CHAR,CHAR (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:9) */ | ||
81 | extern void gtk_marshal_INT__POINTER_CHAR_CHAR (GClosure *closure, | ||
82 | GValue *return_value, | ||
83 | guint n_param_values, | ||
84 | @@ -85,19 +85,19 @@ | ||
85 | gpointer invocation_hint, | ||
86 | gpointer marshal_data); | ||
87 | |||
88 | -/* NONE:BOOL (./gtkmarshal.list:10) */ | ||
89 | +/* NONE:BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:10) */ | ||
90 | #define gtk_marshal_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN | ||
91 | #define gtk_marshal_NONE__BOOL gtk_marshal_VOID__BOOLEAN | ||
92 | |||
93 | -/* NONE:BOXED (./gtkmarshal.list:11) */ | ||
94 | +/* NONE:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:11) */ | ||
95 | #define gtk_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED | ||
96 | #define gtk_marshal_NONE__BOXED gtk_marshal_VOID__BOXED | ||
97 | |||
98 | -/* NONE:ENUM (./gtkmarshal.list:12) */ | ||
99 | +/* NONE:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:12) */ | ||
100 | #define gtk_marshal_VOID__ENUM g_cclosure_marshal_VOID__ENUM | ||
101 | #define gtk_marshal_NONE__ENUM gtk_marshal_VOID__ENUM | ||
102 | |||
103 | -/* NONE:ENUM,FLOAT (./gtkmarshal.list:13) */ | ||
104 | +/* NONE:ENUM,FLOAT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:13) */ | ||
105 | extern void gtk_marshal_VOID__ENUM_FLOAT (GClosure *closure, | ||
106 | GValue *return_value, | ||
107 | guint n_param_values, | ||
108 | @@ -106,7 +106,7 @@ | ||
109 | gpointer marshal_data); | ||
110 | #define gtk_marshal_NONE__ENUM_FLOAT gtk_marshal_VOID__ENUM_FLOAT | ||
111 | |||
112 | -/* NONE:ENUM,FLOAT,BOOL (./gtkmarshal.list:14) */ | ||
113 | +/* NONE:ENUM,FLOAT,BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:14) */ | ||
114 | extern void gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure *closure, | ||
115 | GValue *return_value, | ||
116 | guint n_param_values, | ||
117 | @@ -115,11 +115,11 @@ | ||
118 | gpointer marshal_data); | ||
119 | #define gtk_marshal_NONE__ENUM_FLOAT_BOOL gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN | ||
120 | |||
121 | -/* NONE:INT (./gtkmarshal.list:15) */ | ||
122 | +/* NONE:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:15) */ | ||
123 | #define gtk_marshal_VOID__INT g_cclosure_marshal_VOID__INT | ||
124 | #define gtk_marshal_NONE__INT gtk_marshal_VOID__INT | ||
125 | |||
126 | -/* NONE:INT,INT (./gtkmarshal.list:16) */ | ||
127 | +/* NONE:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:16) */ | ||
128 | extern void gtk_marshal_VOID__INT_INT (GClosure *closure, | ||
129 | GValue *return_value, | ||
130 | guint n_param_values, | ||
131 | @@ -128,7 +128,7 @@ | ||
132 | gpointer marshal_data); | ||
133 | #define gtk_marshal_NONE__INT_INT gtk_marshal_VOID__INT_INT | ||
134 | |||
135 | -/* NONE:INT,INT,POINTER (./gtkmarshal.list:17) */ | ||
136 | +/* NONE:INT,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:17) */ | ||
137 | extern void gtk_marshal_VOID__INT_INT_POINTER (GClosure *closure, | ||
138 | GValue *return_value, | ||
139 | guint n_param_values, | ||
140 | @@ -137,19 +137,19 @@ | ||
141 | gpointer marshal_data); | ||
142 | #define gtk_marshal_NONE__INT_INT_POINTER gtk_marshal_VOID__INT_INT_POINTER | ||
143 | |||
144 | -/* NONE:NONE (./gtkmarshal.list:18) */ | ||
145 | +/* NONE:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:18) */ | ||
146 | #define gtk_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID | ||
147 | #define gtk_marshal_NONE__NONE gtk_marshal_VOID__VOID | ||
148 | |||
149 | -/* NONE:OBJECT (./gtkmarshal.list:19) */ | ||
150 | +/* NONE:OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:19) */ | ||
151 | #define gtk_marshal_VOID__OBJECT g_cclosure_marshal_VOID__OBJECT | ||
152 | #define gtk_marshal_NONE__OBJECT gtk_marshal_VOID__OBJECT | ||
153 | |||
154 | -/* NONE:POINTER (./gtkmarshal.list:20) */ | ||
155 | +/* NONE:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:20) */ | ||
156 | #define gtk_marshal_VOID__POINTER g_cclosure_marshal_VOID__POINTER | ||
157 | #define gtk_marshal_NONE__POINTER gtk_marshal_VOID__POINTER | ||
158 | |||
159 | -/* NONE:POINTER,INT (./gtkmarshal.list:21) */ | ||
160 | +/* NONE:POINTER,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:21) */ | ||
161 | extern void gtk_marshal_VOID__POINTER_INT (GClosure *closure, | ||
162 | GValue *return_value, | ||
163 | guint n_param_values, | ||
164 | @@ -158,7 +158,7 @@ | ||
165 | gpointer marshal_data); | ||
166 | #define gtk_marshal_NONE__POINTER_INT gtk_marshal_VOID__POINTER_INT | ||
167 | |||
168 | -/* NONE:POINTER,POINTER (./gtkmarshal.list:22) */ | ||
169 | +/* NONE:POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:22) */ | ||
170 | extern void gtk_marshal_VOID__POINTER_POINTER (GClosure *closure, | ||
171 | GValue *return_value, | ||
172 | guint n_param_values, | ||
173 | @@ -167,7 +167,7 @@ | ||
174 | gpointer marshal_data); | ||
175 | #define gtk_marshal_NONE__POINTER_POINTER gtk_marshal_VOID__POINTER_POINTER | ||
176 | |||
177 | -/* NONE:POINTER,POINTER,POINTER (./gtkmarshal.list:23) */ | ||
178 | +/* NONE:POINTER,POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:23) */ | ||
179 | extern void gtk_marshal_VOID__POINTER_POINTER_POINTER (GClosure *closure, | ||
180 | GValue *return_value, | ||
181 | guint n_param_values, | ||
182 | @@ -176,7 +176,7 @@ | ||
183 | gpointer marshal_data); | ||
184 | #define gtk_marshal_NONE__POINTER_POINTER_POINTER gtk_marshal_VOID__POINTER_POINTER_POINTER | ||
185 | |||
186 | -/* NONE:POINTER,STRING,STRING (./gtkmarshal.list:24) */ | ||
187 | +/* NONE:POINTER,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:24) */ | ||
188 | extern void gtk_marshal_VOID__POINTER_STRING_STRING (GClosure *closure, | ||
189 | GValue *return_value, | ||
190 | guint n_param_values, | ||
191 | @@ -185,7 +185,7 @@ | ||
192 | gpointer marshal_data); | ||
193 | #define gtk_marshal_NONE__POINTER_STRING_STRING gtk_marshal_VOID__POINTER_STRING_STRING | ||
194 | |||
195 | -/* NONE:POINTER,UINT (./gtkmarshal.list:25) */ | ||
196 | +/* NONE:POINTER,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:25) */ | ||
197 | extern void gtk_marshal_VOID__POINTER_UINT (GClosure *closure, | ||
198 | GValue *return_value, | ||
199 | guint n_param_values, | ||
200 | @@ -194,7 +194,7 @@ | ||
201 | gpointer marshal_data); | ||
202 | #define gtk_marshal_NONE__POINTER_UINT gtk_marshal_VOID__POINTER_UINT | ||
203 | |||
204 | -/* NONE:POINTER,UINT,ENUM (./gtkmarshal.list:26) */ | ||
205 | +/* NONE:POINTER,UINT,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:26) */ | ||
206 | extern void gtk_marshal_VOID__POINTER_UINT_ENUM (GClosure *closure, | ||
207 | GValue *return_value, | ||
208 | guint n_param_values, | ||
209 | @@ -203,7 +203,7 @@ | ||
210 | gpointer marshal_data); | ||
211 | #define gtk_marshal_NONE__POINTER_UINT_ENUM gtk_marshal_VOID__POINTER_UINT_ENUM | ||
212 | |||
213 | -/* NONE:POINTER,POINTER,UINT,UINT (./gtkmarshal.list:27) */ | ||
214 | +/* NONE:POINTER,POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:27) */ | ||
215 | extern void gtk_marshal_VOID__POINTER_POINTER_UINT_UINT (GClosure *closure, | ||
216 | GValue *return_value, | ||
217 | guint n_param_values, | ||
218 | @@ -212,7 +212,7 @@ | ||
219 | gpointer marshal_data); | ||
220 | #define gtk_marshal_NONE__POINTER_POINTER_UINT_UINT gtk_marshal_VOID__POINTER_POINTER_UINT_UINT | ||
221 | |||
222 | -/* NONE:POINTER,INT,INT,POINTER,UINT,UINT (./gtkmarshal.list:28) */ | ||
223 | +/* NONE:POINTER,INT,INT,POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:28) */ | ||
224 | extern void gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT (GClosure *closure, | ||
225 | GValue *return_value, | ||
226 | guint n_param_values, | ||
227 | @@ -221,7 +221,7 @@ | ||
228 | gpointer marshal_data); | ||
229 | #define gtk_marshal_NONE__POINTER_INT_INT_POINTER_UINT_UINT gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT | ||
230 | |||
231 | -/* NONE:POINTER,UINT,UINT (./gtkmarshal.list:29) */ | ||
232 | +/* NONE:POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:29) */ | ||
233 | extern void gtk_marshal_VOID__POINTER_UINT_UINT (GClosure *closure, | ||
234 | GValue *return_value, | ||
235 | guint n_param_values, | ||
236 | @@ -230,13 +230,13 @@ | ||
237 | gpointer marshal_data); | ||
238 | #define gtk_marshal_NONE__POINTER_UINT_UINT gtk_marshal_VOID__POINTER_UINT_UINT | ||
239 | |||
240 | -/* NONE:POINTER,UINT,UINT (./gtkmarshal.list:30) */ | ||
241 | +/* NONE:POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:30) */ | ||
242 | |||
243 | -/* NONE:STRING (./gtkmarshal.list:31) */ | ||
244 | +/* NONE:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:31) */ | ||
245 | #define gtk_marshal_VOID__STRING g_cclosure_marshal_VOID__STRING | ||
246 | #define gtk_marshal_NONE__STRING gtk_marshal_VOID__STRING | ||
247 | |||
248 | -/* NONE:STRING,INT,POINTER (./gtkmarshal.list:32) */ | ||
249 | +/* NONE:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:32) */ | ||
250 | extern void gtk_marshal_VOID__STRING_INT_POINTER (GClosure *closure, | ||
251 | GValue *return_value, | ||
252 | guint n_param_values, | ||
253 | @@ -245,11 +245,11 @@ | ||
254 | gpointer marshal_data); | ||
255 | #define gtk_marshal_NONE__STRING_INT_POINTER gtk_marshal_VOID__STRING_INT_POINTER | ||
256 | |||
257 | -/* NONE:UINT (./gtkmarshal.list:33) */ | ||
258 | +/* NONE:UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:33) */ | ||
259 | #define gtk_marshal_VOID__UINT g_cclosure_marshal_VOID__UINT | ||
260 | #define gtk_marshal_NONE__UINT gtk_marshal_VOID__UINT | ||
261 | |||
262 | -/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (./gtkmarshal.list:34) */ | ||
263 | +/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:34) */ | ||
264 | extern void gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER (GClosure *closure, | ||
265 | GValue *return_value, | ||
266 | guint n_param_values, | ||
267 | @@ -258,7 +258,7 @@ | ||
268 | gpointer marshal_data); | ||
269 | #define gtk_marshal_NONE__UINT_POINTER_UINT_ENUM_ENUM_POINTER gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER | ||
270 | |||
271 | -/* NONE:UINT,POINTER,UINT,UINT,ENUM (./gtkmarshal.list:35) */ | ||
272 | +/* NONE:UINT,POINTER,UINT,UINT,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:35) */ | ||
273 | extern void gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM (GClosure *closure, | ||
274 | GValue *return_value, | ||
275 | guint n_param_values, | ||
276 | @@ -267,7 +267,7 @@ | ||
277 | gpointer marshal_data); | ||
278 | #define gtk_marshal_NONE__UINT_POINTER_UINT_UINT_ENUM gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM | ||
279 | |||
280 | -/* NONE:UINT,STRING (./gtkmarshal.list:36) */ | ||
281 | +/* NONE:UINT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:36) */ | ||
282 | extern void gtk_marshal_VOID__UINT_STRING (GClosure *closure, | ||
283 | GValue *return_value, | ||
284 | guint n_param_values, | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshalers.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshalers.c.diff deleted file mode 100644 index 7f22a0e5d9..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshalers.c.diff +++ /dev/null | |||
@@ -1,606 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmarshalers.c 2005-03-01 17:58:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmarshalers.c 2005-04-06 16:19:36.902928264 +0300 | ||
3 | @@ -48,7 +48,7 @@ | ||
4 | #endif /* !G_ENABLE_DEBUG */ | ||
5 | |||
6 | |||
7 | -/* BOOLEAN:BOXED (./gtkmarshalers.list:24) */ | ||
8 | +/* BOOLEAN:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:24) */ | ||
9 | void | ||
10 | _gtk_marshal_BOOLEAN__BOXED (GClosure *closure, | ||
11 | GValue *return_value, | ||
12 | @@ -87,7 +87,7 @@ | ||
13 | g_value_set_boolean (return_value, v_return); | ||
14 | } | ||
15 | |||
16 | -/* BOOLEAN:BOXED,BOXED (./gtkmarshalers.list:25) */ | ||
17 | +/* BOOLEAN:BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:25) */ | ||
18 | void | ||
19 | _gtk_marshal_BOOLEAN__BOXED_BOXED (GClosure *closure, | ||
20 | GValue *return_value, | ||
21 | @@ -128,7 +128,7 @@ | ||
22 | g_value_set_boolean (return_value, v_return); | ||
23 | } | ||
24 | |||
25 | -/* BOOLEAN:ENUM (./gtkmarshalers.list:26) */ | ||
26 | +/* BOOLEAN:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:26) */ | ||
27 | void | ||
28 | _gtk_marshal_BOOLEAN__ENUM (GClosure *closure, | ||
29 | GValue *return_value, | ||
30 | @@ -167,7 +167,7 @@ | ||
31 | g_value_set_boolean (return_value, v_return); | ||
32 | } | ||
33 | |||
34 | -/* BOOLEAN:ENUM,DOUBLE (./gtkmarshalers.list:27) */ | ||
35 | +/* BOOLEAN:ENUM,DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:27) */ | ||
36 | void | ||
37 | _gtk_marshal_BOOLEAN__ENUM_DOUBLE (GClosure *closure, | ||
38 | GValue *return_value, | ||
39 | @@ -208,7 +208,7 @@ | ||
40 | g_value_set_boolean (return_value, v_return); | ||
41 | } | ||
42 | |||
43 | -/* BOOLEAN:ENUM,INT (./gtkmarshalers.list:28) */ | ||
44 | +/* BOOLEAN:ENUM,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:28) */ | ||
45 | void | ||
46 | _gtk_marshal_BOOLEAN__ENUM_INT (GClosure *closure, | ||
47 | GValue *return_value, | ||
48 | @@ -249,7 +249,7 @@ | ||
49 | g_value_set_boolean (return_value, v_return); | ||
50 | } | ||
51 | |||
52 | -/* BOOLEAN:OBJECT,UINT,FLAGS (./gtkmarshalers.list:29) */ | ||
53 | +/* BOOLEAN:OBJECT,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:29) */ | ||
54 | void | ||
55 | _gtk_marshal_BOOLEAN__OBJECT_UINT_FLAGS (GClosure *closure, | ||
56 | GValue *return_value, | ||
57 | @@ -292,7 +292,7 @@ | ||
58 | g_value_set_boolean (return_value, v_return); | ||
59 | } | ||
60 | |||
61 | -/* BOOLEAN:OBJECT,INT,INT,UINT (./gtkmarshalers.list:30) */ | ||
62 | +/* BOOLEAN:OBJECT,INT,INT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:30) */ | ||
63 | void | ||
64 | _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT (GClosure *closure, | ||
65 | GValue *return_value, | ||
66 | @@ -337,7 +337,7 @@ | ||
67 | g_value_set_boolean (return_value, v_return); | ||
68 | } | ||
69 | |||
70 | -/* BOOLEAN:OBJECT,STRING,STRING,BOXED (./gtkmarshalers.list:31) */ | ||
71 | +/* BOOLEAN:OBJECT,STRING,STRING,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:31) */ | ||
72 | void | ||
73 | _gtk_marshal_BOOLEAN__OBJECT_STRING_STRING_BOXED (GClosure *closure, | ||
74 | GValue *return_value, | ||
75 | @@ -382,7 +382,7 @@ | ||
76 | g_value_set_boolean (return_value, v_return); | ||
77 | } | ||
78 | |||
79 | -/* BOOLEAN:OBJECT,BOXED (./gtkmarshalers.list:32) */ | ||
80 | +/* BOOLEAN:OBJECT,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:32) */ | ||
81 | void | ||
82 | _gtk_marshal_BOOLEAN__OBJECT_BOXED (GClosure *closure, | ||
83 | GValue *return_value, | ||
84 | @@ -423,7 +423,7 @@ | ||
85 | g_value_set_boolean (return_value, v_return); | ||
86 | } | ||
87 | |||
88 | -/* BOOLEAN:OBJECT,BOXED,BOXED (./gtkmarshalers.list:33) */ | ||
89 | +/* BOOLEAN:OBJECT,BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:33) */ | ||
90 | void | ||
91 | _gtk_marshal_BOOLEAN__OBJECT_BOXED_BOXED (GClosure *closure, | ||
92 | GValue *return_value, | ||
93 | @@ -466,7 +466,7 @@ | ||
94 | g_value_set_boolean (return_value, v_return); | ||
95 | } | ||
96 | |||
97 | -/* BOOLEAN:OBJECT,STRING,STRING (./gtkmarshalers.list:34) */ | ||
98 | +/* BOOLEAN:OBJECT,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:34) */ | ||
99 | void | ||
100 | _gtk_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure *closure, | ||
101 | GValue *return_value, | ||
102 | @@ -509,7 +509,7 @@ | ||
103 | g_value_set_boolean (return_value, v_return); | ||
104 | } | ||
105 | |||
106 | -/* BOOLEAN:INT,INT (./gtkmarshalers.list:35) */ | ||
107 | +/* BOOLEAN:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:35) */ | ||
108 | void | ||
109 | _gtk_marshal_BOOLEAN__INT_INT (GClosure *closure, | ||
110 | GValue *return_value, | ||
111 | @@ -550,7 +550,7 @@ | ||
112 | g_value_set_boolean (return_value, v_return); | ||
113 | } | ||
114 | |||
115 | -/* BOOLEAN:INT,INT,INT (./gtkmarshalers.list:36) */ | ||
116 | +/* BOOLEAN:INT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:36) */ | ||
117 | void | ||
118 | _gtk_marshal_BOOLEAN__INT_INT_INT (GClosure *closure, | ||
119 | GValue *return_value, | ||
120 | @@ -593,7 +593,7 @@ | ||
121 | g_value_set_boolean (return_value, v_return); | ||
122 | } | ||
123 | |||
124 | -/* BOOLEAN:UINT (./gtkmarshalers.list:37) */ | ||
125 | +/* BOOLEAN:UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:37) */ | ||
126 | void | ||
127 | _gtk_marshal_BOOLEAN__UINT (GClosure *closure, | ||
128 | GValue *return_value, | ||
129 | @@ -632,7 +632,7 @@ | ||
130 | g_value_set_boolean (return_value, v_return); | ||
131 | } | ||
132 | |||
133 | -/* BOOLEAN:VOID (./gtkmarshalers.list:38) */ | ||
134 | +/* BOOLEAN:VOID (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:38) */ | ||
135 | void | ||
136 | _gtk_marshal_BOOLEAN__VOID (GClosure *closure, | ||
137 | GValue *return_value, | ||
138 | @@ -669,7 +669,7 @@ | ||
139 | g_value_set_boolean (return_value, v_return); | ||
140 | } | ||
141 | |||
142 | -/* BOOLEAN:BOOLEAN (./gtkmarshalers.list:39) */ | ||
143 | +/* BOOLEAN:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:39) */ | ||
144 | void | ||
145 | _gtk_marshal_BOOLEAN__BOOLEAN (GClosure *closure, | ||
146 | GValue *return_value, | ||
147 | @@ -708,9 +708,9 @@ | ||
148 | g_value_set_boolean (return_value, v_return); | ||
149 | } | ||
150 | |||
151 | -/* BOOLEAN:NONE (./gtkmarshalers.list:40) */ | ||
152 | +/* BOOLEAN:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:40) */ | ||
153 | |||
154 | -/* BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN (./gtkmarshalers.list:41) */ | ||
155 | +/* BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:41) */ | ||
156 | void | ||
157 | _gtk_marshal_BOOLEAN__BOOLEAN_BOOLEAN_BOOLEAN (GClosure *closure, | ||
158 | GValue *return_value, | ||
159 | @@ -753,7 +753,7 @@ | ||
160 | g_value_set_boolean (return_value, v_return); | ||
161 | } | ||
162 | |||
163 | -/* BOOLEAN:STRING (./gtkmarshalers.list:42) */ | ||
164 | +/* BOOLEAN:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:42) */ | ||
165 | void | ||
166 | _gtk_marshal_BOOLEAN__STRING (GClosure *closure, | ||
167 | GValue *return_value, | ||
168 | @@ -792,7 +792,7 @@ | ||
169 | g_value_set_boolean (return_value, v_return); | ||
170 | } | ||
171 | |||
172 | -/* ENUM:ENUM (./gtkmarshalers.list:43) */ | ||
173 | +/* ENUM:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:43) */ | ||
174 | void | ||
175 | _gtk_marshal_ENUM__ENUM (GClosure *closure, | ||
176 | GValue *return_value, | ||
177 | @@ -831,7 +831,7 @@ | ||
178 | g_value_set_enum (return_value, v_return); | ||
179 | } | ||
180 | |||
181 | -/* INT:POINTER (./gtkmarshalers.list:44) */ | ||
182 | +/* INT:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:44) */ | ||
183 | void | ||
184 | _gtk_marshal_INT__POINTER (GClosure *closure, | ||
185 | GValue *return_value, | ||
186 | @@ -870,13 +870,13 @@ | ||
187 | g_value_set_int (return_value, v_return); | ||
188 | } | ||
189 | |||
190 | -/* NONE:BOOLEAN (./gtkmarshalers.list:45) */ | ||
191 | +/* NONE:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:45) */ | ||
192 | |||
193 | -/* NONE:ENUM (./gtkmarshalers.list:46) */ | ||
194 | +/* NONE:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:46) */ | ||
195 | |||
196 | -/* NONE:INT (./gtkmarshalers.list:47) */ | ||
197 | +/* NONE:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:47) */ | ||
198 | |||
199 | -/* NONE:INT,BOOL (./gtkmarshalers.list:48) */ | ||
200 | +/* NONE:INT,BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:48) */ | ||
201 | void | ||
202 | _gtk_marshal_VOID__INT_BOOLEAN (GClosure *closure, | ||
203 | GValue *return_value, | ||
204 | @@ -913,7 +913,7 @@ | ||
205 | data2); | ||
206 | } | ||
207 | |||
208 | -/* NONE:INT,INT (./gtkmarshalers.list:49) */ | ||
209 | +/* NONE:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:49) */ | ||
210 | void | ||
211 | _gtk_marshal_VOID__INT_INT (GClosure *closure, | ||
212 | GValue *return_value, | ||
213 | @@ -950,9 +950,9 @@ | ||
214 | data2); | ||
215 | } | ||
216 | |||
217 | -/* NONE:NONE (./gtkmarshalers.list:50) */ | ||
218 | +/* NONE:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:50) */ | ||
219 | |||
220 | -/* NONE:STRING,INT,POINTER (./gtkmarshalers.list:51) */ | ||
221 | +/* NONE:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:51) */ | ||
222 | void | ||
223 | _gtk_marshal_VOID__STRING_INT_POINTER (GClosure *closure, | ||
224 | GValue *return_value, | ||
225 | @@ -991,7 +991,7 @@ | ||
226 | data2); | ||
227 | } | ||
228 | |||
229 | -/* STRING:DOUBLE (./gtkmarshalers.list:52) */ | ||
230 | +/* STRING:DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:52) */ | ||
231 | void | ||
232 | _gtk_marshal_STRING__DOUBLE (GClosure *closure, | ||
233 | GValue *return_value, | ||
234 | @@ -1030,11 +1030,11 @@ | ||
235 | g_value_take_string (return_value, v_return); | ||
236 | } | ||
237 | |||
238 | -/* VOID:DOUBLE (./gtkmarshalers.list:53) */ | ||
239 | +/* VOID:DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:53) */ | ||
240 | |||
241 | -/* VOID:BOOLEAN (./gtkmarshalers.list:54) */ | ||
242 | +/* VOID:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:54) */ | ||
243 | |||
244 | -/* VOID:BOOLEAN,BOOLEAN,BOOLEAN (./gtkmarshalers.list:55) */ | ||
245 | +/* VOID:BOOLEAN,BOOLEAN,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:55) */ | ||
246 | void | ||
247 | _gtk_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN (GClosure *closure, | ||
248 | GValue *return_value, | ||
249 | @@ -1073,9 +1073,9 @@ | ||
250 | data2); | ||
251 | } | ||
252 | |||
253 | -/* VOID:BOXED (./gtkmarshalers.list:56) */ | ||
254 | +/* VOID:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:56) */ | ||
255 | |||
256 | -/* VOID:BOXED,BOXED (./gtkmarshalers.list:57) */ | ||
257 | +/* VOID:BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:57) */ | ||
258 | void | ||
259 | _gtk_marshal_VOID__BOXED_BOXED (GClosure *closure, | ||
260 | GValue *return_value, | ||
261 | @@ -1112,7 +1112,7 @@ | ||
262 | data2); | ||
263 | } | ||
264 | |||
265 | -/* VOID:BOXED,BOXED,POINTER (./gtkmarshalers.list:58) */ | ||
266 | +/* VOID:BOXED,BOXED,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:58) */ | ||
267 | void | ||
268 | _gtk_marshal_VOID__BOXED_BOXED_POINTER (GClosure *closure, | ||
269 | GValue *return_value, | ||
270 | @@ -1151,7 +1151,7 @@ | ||
271 | data2); | ||
272 | } | ||
273 | |||
274 | -/* VOID:BOXED,OBJECT (./gtkmarshalers.list:59) */ | ||
275 | +/* VOID:BOXED,OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:59) */ | ||
276 | void | ||
277 | _gtk_marshal_VOID__BOXED_OBJECT (GClosure *closure, | ||
278 | GValue *return_value, | ||
279 | @@ -1188,7 +1188,7 @@ | ||
280 | data2); | ||
281 | } | ||
282 | |||
283 | -/* VOID:BOXED,STRING,INT (./gtkmarshalers.list:60) */ | ||
284 | +/* VOID:BOXED,STRING,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:60) */ | ||
285 | void | ||
286 | _gtk_marshal_VOID__BOXED_STRING_INT (GClosure *closure, | ||
287 | GValue *return_value, | ||
288 | @@ -1227,7 +1227,7 @@ | ||
289 | data2); | ||
290 | } | ||
291 | |||
292 | -/* VOID:BOXED,UINT (./gtkmarshalers.list:61) */ | ||
293 | +/* VOID:BOXED,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:61) */ | ||
294 | void | ||
295 | _gtk_marshal_VOID__BOXED_UINT (GClosure *closure, | ||
296 | GValue *return_value, | ||
297 | @@ -1264,7 +1264,7 @@ | ||
298 | data2); | ||
299 | } | ||
300 | |||
301 | -/* VOID:BOXED,UINT,FLAGS (./gtkmarshalers.list:62) */ | ||
302 | +/* VOID:BOXED,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:62) */ | ||
303 | void | ||
304 | _gtk_marshal_VOID__BOXED_UINT_FLAGS (GClosure *closure, | ||
305 | GValue *return_value, | ||
306 | @@ -1303,7 +1303,7 @@ | ||
307 | data2); | ||
308 | } | ||
309 | |||
310 | -/* VOID:BOXED,UINT,UINT (./gtkmarshalers.list:63) */ | ||
311 | +/* VOID:BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:63) */ | ||
312 | void | ||
313 | _gtk_marshal_VOID__BOXED_UINT_UINT (GClosure *closure, | ||
314 | GValue *return_value, | ||
315 | @@ -1342,9 +1342,9 @@ | ||
316 | data2); | ||
317 | } | ||
318 | |||
319 | -/* VOID:ENUM (./gtkmarshalers.list:64) */ | ||
320 | +/* VOID:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:64) */ | ||
321 | |||
322 | -/* VOID:ENUM,BOOLEAN (./gtkmarshalers.list:65) */ | ||
323 | +/* VOID:ENUM,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:65) */ | ||
324 | void | ||
325 | _gtk_marshal_VOID__ENUM_BOOLEAN (GClosure *closure, | ||
326 | GValue *return_value, | ||
327 | @@ -1381,7 +1381,7 @@ | ||
328 | data2); | ||
329 | } | ||
330 | |||
331 | -/* VOID:ENUM,ENUM (./gtkmarshalers.list:66) */ | ||
332 | +/* VOID:ENUM,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:66) */ | ||
333 | void | ||
334 | _gtk_marshal_VOID__ENUM_ENUM (GClosure *closure, | ||
335 | GValue *return_value, | ||
336 | @@ -1418,7 +1418,7 @@ | ||
337 | data2); | ||
338 | } | ||
339 | |||
340 | -/* VOID:ENUM,FLOAT (./gtkmarshalers.list:67) */ | ||
341 | +/* VOID:ENUM,FLOAT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:67) */ | ||
342 | void | ||
343 | _gtk_marshal_VOID__ENUM_FLOAT (GClosure *closure, | ||
344 | GValue *return_value, | ||
345 | @@ -1455,7 +1455,7 @@ | ||
346 | data2); | ||
347 | } | ||
348 | |||
349 | -/* VOID:ENUM,FLOAT,BOOLEAN (./gtkmarshalers.list:68) */ | ||
350 | +/* VOID:ENUM,FLOAT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:68) */ | ||
351 | void | ||
352 | _gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure *closure, | ||
353 | GValue *return_value, | ||
354 | @@ -1494,7 +1494,7 @@ | ||
355 | data2); | ||
356 | } | ||
357 | |||
358 | -/* VOID:ENUM,INT (./gtkmarshalers.list:69) */ | ||
359 | +/* VOID:ENUM,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:69) */ | ||
360 | void | ||
361 | _gtk_marshal_VOID__ENUM_INT (GClosure *closure, | ||
362 | GValue *return_value, | ||
363 | @@ -1531,7 +1531,7 @@ | ||
364 | data2); | ||
365 | } | ||
366 | |||
367 | -/* VOID:ENUM,INT,BOOLEAN (./gtkmarshalers.list:70) */ | ||
368 | +/* VOID:ENUM,INT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:70) */ | ||
369 | void | ||
370 | _gtk_marshal_VOID__ENUM_INT_BOOLEAN (GClosure *closure, | ||
371 | GValue *return_value, | ||
372 | @@ -1570,11 +1570,11 @@ | ||
373 | data2); | ||
374 | } | ||
375 | |||
376 | -/* VOID:INT (./gtkmarshalers.list:71) */ | ||
377 | +/* VOID:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:71) */ | ||
378 | |||
379 | -/* VOID:INT,INT (./gtkmarshalers.list:72) */ | ||
380 | +/* VOID:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:72) */ | ||
381 | |||
382 | -/* VOID:INT,INT,BOXED (./gtkmarshalers.list:73) */ | ||
383 | +/* VOID:INT,INT,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:73) */ | ||
384 | void | ||
385 | _gtk_marshal_VOID__INT_INT_BOXED (GClosure *closure, | ||
386 | GValue *return_value, | ||
387 | @@ -1613,7 +1613,7 @@ | ||
388 | data2); | ||
389 | } | ||
390 | |||
391 | -/* VOID:INT,INT,INT (./gtkmarshalers.list:74) */ | ||
392 | +/* VOID:INT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:74) */ | ||
393 | void | ||
394 | _gtk_marshal_VOID__INT_INT_INT (GClosure *closure, | ||
395 | GValue *return_value, | ||
396 | @@ -1652,9 +1652,9 @@ | ||
397 | data2); | ||
398 | } | ||
399 | |||
400 | -/* VOID:OBJECT (./gtkmarshalers.list:75) */ | ||
401 | +/* VOID:OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:75) */ | ||
402 | |||
403 | -/* VOID:OBJECT,BOOLEAN (./gtkmarshalers.list:76) */ | ||
404 | +/* VOID:OBJECT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:76) */ | ||
405 | void | ||
406 | _gtk_marshal_VOID__OBJECT_BOOLEAN (GClosure *closure, | ||
407 | GValue *return_value, | ||
408 | @@ -1691,7 +1691,7 @@ | ||
409 | data2); | ||
410 | } | ||
411 | |||
412 | -/* VOID:OBJECT,BOXED,BOXED (./gtkmarshalers.list:77) */ | ||
413 | +/* VOID:OBJECT,BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:77) */ | ||
414 | void | ||
415 | _gtk_marshal_VOID__OBJECT_BOXED_BOXED (GClosure *closure, | ||
416 | GValue *return_value, | ||
417 | @@ -1730,7 +1730,7 @@ | ||
418 | data2); | ||
419 | } | ||
420 | |||
421 | -/* VOID:OBJECT,BOXED,UINT,UINT (./gtkmarshalers.list:78) */ | ||
422 | +/* VOID:OBJECT,BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:78) */ | ||
423 | void | ||
424 | _gtk_marshal_VOID__OBJECT_BOXED_UINT_UINT (GClosure *closure, | ||
425 | GValue *return_value, | ||
426 | @@ -1771,7 +1771,7 @@ | ||
427 | data2); | ||
428 | } | ||
429 | |||
430 | -/* VOID:OBJECT,INT,INT (./gtkmarshalers.list:79) */ | ||
431 | +/* VOID:OBJECT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:79) */ | ||
432 | void | ||
433 | _gtk_marshal_VOID__OBJECT_INT_INT (GClosure *closure, | ||
434 | GValue *return_value, | ||
435 | @@ -1810,7 +1810,7 @@ | ||
436 | data2); | ||
437 | } | ||
438 | |||
439 | -/* VOID:OBJECT,INT,INT,BOXED,UINT,UINT (./gtkmarshalers.list:80) */ | ||
440 | +/* VOID:OBJECT,INT,INT,BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:80) */ | ||
441 | void | ||
442 | _gtk_marshal_VOID__OBJECT_INT_INT_BOXED_UINT_UINT (GClosure *closure, | ||
443 | GValue *return_value, | ||
444 | @@ -1855,7 +1855,7 @@ | ||
445 | data2); | ||
446 | } | ||
447 | |||
448 | -/* VOID:OBJECT,OBJECT (./gtkmarshalers.list:81) */ | ||
449 | +/* VOID:OBJECT,OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:81) */ | ||
450 | void | ||
451 | _gtk_marshal_VOID__OBJECT_OBJECT (GClosure *closure, | ||
452 | GValue *return_value, | ||
453 | @@ -1892,7 +1892,7 @@ | ||
454 | data2); | ||
455 | } | ||
456 | |||
457 | -/* VOID:OBJECT,STRING (./gtkmarshalers.list:82) */ | ||
458 | +/* VOID:OBJECT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:82) */ | ||
459 | void | ||
460 | _gtk_marshal_VOID__OBJECT_STRING (GClosure *closure, | ||
461 | GValue *return_value, | ||
462 | @@ -1929,7 +1929,7 @@ | ||
463 | data2); | ||
464 | } | ||
465 | |||
466 | -/* VOID:OBJECT,STRING,STRING (./gtkmarshalers.list:83) */ | ||
467 | +/* VOID:OBJECT,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:83) */ | ||
468 | void | ||
469 | _gtk_marshal_VOID__OBJECT_STRING_STRING (GClosure *closure, | ||
470 | GValue *return_value, | ||
471 | @@ -1968,7 +1968,7 @@ | ||
472 | data2); | ||
473 | } | ||
474 | |||
475 | -/* VOID:OBJECT,UINT (./gtkmarshalers.list:84) */ | ||
476 | +/* VOID:OBJECT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:84) */ | ||
477 | void | ||
478 | _gtk_marshal_VOID__OBJECT_UINT (GClosure *closure, | ||
479 | GValue *return_value, | ||
480 | @@ -2005,7 +2005,7 @@ | ||
481 | data2); | ||
482 | } | ||
483 | |||
484 | -/* VOID:OBJECT,UINT,FLAGS (./gtkmarshalers.list:85) */ | ||
485 | +/* VOID:OBJECT,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:85) */ | ||
486 | void | ||
487 | _gtk_marshal_VOID__OBJECT_UINT_FLAGS (GClosure *closure, | ||
488 | GValue *return_value, | ||
489 | @@ -2044,11 +2044,11 @@ | ||
490 | data2); | ||
491 | } | ||
492 | |||
493 | -/* VOID:OBJECT,STRING (./gtkmarshalers.list:86) */ | ||
494 | +/* VOID:OBJECT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:86) */ | ||
495 | |||
496 | -/* VOID:POINTER (./gtkmarshalers.list:87) */ | ||
497 | +/* VOID:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:87) */ | ||
498 | |||
499 | -/* VOID:POINTER,INT (./gtkmarshalers.list:88) */ | ||
500 | +/* VOID:POINTER,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:88) */ | ||
501 | void | ||
502 | _gtk_marshal_VOID__POINTER_INT (GClosure *closure, | ||
503 | GValue *return_value, | ||
504 | @@ -2085,7 +2085,7 @@ | ||
505 | data2); | ||
506 | } | ||
507 | |||
508 | -/* VOID:POINTER,BOOLEAN (./gtkmarshalers.list:89) */ | ||
509 | +/* VOID:POINTER,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:89) */ | ||
510 | void | ||
511 | _gtk_marshal_VOID__POINTER_BOOLEAN (GClosure *closure, | ||
512 | GValue *return_value, | ||
513 | @@ -2122,7 +2122,7 @@ | ||
514 | data2); | ||
515 | } | ||
516 | |||
517 | -/* VOID:POINTER,POINTER,POINTER (./gtkmarshalers.list:90) */ | ||
518 | +/* VOID:POINTER,POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:90) */ | ||
519 | void | ||
520 | _gtk_marshal_VOID__POINTER_POINTER_POINTER (GClosure *closure, | ||
521 | GValue *return_value, | ||
522 | @@ -2161,7 +2161,7 @@ | ||
523 | data2); | ||
524 | } | ||
525 | |||
526 | -/* VOID:POINTER,UINT (./gtkmarshalers.list:91) */ | ||
527 | +/* VOID:POINTER,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:91) */ | ||
528 | void | ||
529 | _gtk_marshal_VOID__POINTER_UINT (GClosure *closure, | ||
530 | GValue *return_value, | ||
531 | @@ -2198,9 +2198,9 @@ | ||
532 | data2); | ||
533 | } | ||
534 | |||
535 | -/* VOID:STRING (./gtkmarshalers.list:92) */ | ||
536 | +/* VOID:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:92) */ | ||
537 | |||
538 | -/* VOID:STRING,STRING (./gtkmarshalers.list:93) */ | ||
539 | +/* VOID:STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:93) */ | ||
540 | void | ||
541 | _gtk_marshal_VOID__STRING_STRING (GClosure *closure, | ||
542 | GValue *return_value, | ||
543 | @@ -2237,9 +2237,9 @@ | ||
544 | data2); | ||
545 | } | ||
546 | |||
547 | -/* VOID:STRING,INT,POINTER (./gtkmarshalers.list:94) */ | ||
548 | +/* VOID:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:94) */ | ||
549 | |||
550 | -/* VOID:STRING,UINT,FLAGS (./gtkmarshalers.list:95) */ | ||
551 | +/* VOID:STRING,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:95) */ | ||
552 | void | ||
553 | _gtk_marshal_VOID__STRING_UINT_FLAGS (GClosure *closure, | ||
554 | GValue *return_value, | ||
555 | @@ -2278,7 +2278,7 @@ | ||
556 | data2); | ||
557 | } | ||
558 | |||
559 | -/* VOID:UINT,FLAGS,BOXED (./gtkmarshalers.list:96) */ | ||
560 | +/* VOID:UINT,FLAGS,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:96) */ | ||
561 | void | ||
562 | _gtk_marshal_VOID__UINT_FLAGS_BOXED (GClosure *closure, | ||
563 | GValue *return_value, | ||
564 | @@ -2317,7 +2317,7 @@ | ||
565 | data2); | ||
566 | } | ||
567 | |||
568 | -/* VOID:UINT,UINT (./gtkmarshalers.list:97) */ | ||
569 | +/* VOID:UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:97) */ | ||
570 | void | ||
571 | _gtk_marshal_VOID__UINT_UINT (GClosure *closure, | ||
572 | GValue *return_value, | ||
573 | @@ -2354,7 +2354,7 @@ | ||
574 | data2); | ||
575 | } | ||
576 | |||
577 | -/* VOID:UINT,STRING (./gtkmarshalers.list:98) */ | ||
578 | +/* VOID:UINT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:98) */ | ||
579 | void | ||
580 | _gtk_marshal_VOID__UINT_STRING (GClosure *closure, | ||
581 | GValue *return_value, | ||
582 | @@ -2391,7 +2391,7 @@ | ||
583 | data2); | ||
584 | } | ||
585 | |||
586 | -/* VOID:UINT,BOXED,UINT,FLAGS,FLAGS (./gtkmarshalers.list:99) */ | ||
587 | +/* VOID:UINT,BOXED,UINT,FLAGS,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:99) */ | ||
588 | void | ||
589 | _gtk_marshal_VOID__UINT_BOXED_UINT_FLAGS_FLAGS (GClosure *closure, | ||
590 | GValue *return_value, | ||
591 | @@ -2434,7 +2434,7 @@ | ||
592 | data2); | ||
593 | } | ||
594 | |||
595 | -/* VOID:UINT,OBJECT,UINT,FLAGS,FLAGS (./gtkmarshalers.list:100) */ | ||
596 | +/* VOID:UINT,OBJECT,UINT,FLAGS,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:100) */ | ||
597 | void | ||
598 | _gtk_marshal_VOID__UINT_OBJECT_UINT_FLAGS_FLAGS (GClosure *closure, | ||
599 | GValue *return_value, | ||
600 | @@ -2477,5 +2477,5 @@ | ||
601 | data2); | ||
602 | } | ||
603 | |||
604 | -/* VOID:VOID (./gtkmarshalers.list:101) */ | ||
605 | +/* VOID:VOID (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:101) */ | ||
606 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshalers.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshalers.h.diff deleted file mode 100644 index e6941631e4..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmarshalers.h.diff +++ /dev/null | |||
@@ -1,622 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmarshalers.h 2005-03-01 17:58:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmarshalers.h 2005-04-06 16:19:36.903928112 +0300 | ||
3 | @@ -6,7 +6,7 @@ | ||
4 | |||
5 | G_BEGIN_DECLS | ||
6 | |||
7 | -/* BOOLEAN:BOXED (./gtkmarshalers.list:24) */ | ||
8 | +/* BOOLEAN:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:24) */ | ||
9 | extern void _gtk_marshal_BOOLEAN__BOXED (GClosure *closure, | ||
10 | GValue *return_value, | ||
11 | guint n_param_values, | ||
12 | @@ -14,7 +14,7 @@ | ||
13 | gpointer invocation_hint, | ||
14 | gpointer marshal_data); | ||
15 | |||
16 | -/* BOOLEAN:BOXED,BOXED (./gtkmarshalers.list:25) */ | ||
17 | +/* BOOLEAN:BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:25) */ | ||
18 | extern void _gtk_marshal_BOOLEAN__BOXED_BOXED (GClosure *closure, | ||
19 | GValue *return_value, | ||
20 | guint n_param_values, | ||
21 | @@ -22,7 +22,7 @@ | ||
22 | gpointer invocation_hint, | ||
23 | gpointer marshal_data); | ||
24 | |||
25 | -/* BOOLEAN:ENUM (./gtkmarshalers.list:26) */ | ||
26 | +/* BOOLEAN:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:26) */ | ||
27 | extern void _gtk_marshal_BOOLEAN__ENUM (GClosure *closure, | ||
28 | GValue *return_value, | ||
29 | guint n_param_values, | ||
30 | @@ -30,7 +30,7 @@ | ||
31 | gpointer invocation_hint, | ||
32 | gpointer marshal_data); | ||
33 | |||
34 | -/* BOOLEAN:ENUM,DOUBLE (./gtkmarshalers.list:27) */ | ||
35 | +/* BOOLEAN:ENUM,DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:27) */ | ||
36 | extern void _gtk_marshal_BOOLEAN__ENUM_DOUBLE (GClosure *closure, | ||
37 | GValue *return_value, | ||
38 | guint n_param_values, | ||
39 | @@ -38,7 +38,7 @@ | ||
40 | gpointer invocation_hint, | ||
41 | gpointer marshal_data); | ||
42 | |||
43 | -/* BOOLEAN:ENUM,INT (./gtkmarshalers.list:28) */ | ||
44 | +/* BOOLEAN:ENUM,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:28) */ | ||
45 | extern void _gtk_marshal_BOOLEAN__ENUM_INT (GClosure *closure, | ||
46 | GValue *return_value, | ||
47 | guint n_param_values, | ||
48 | @@ -46,7 +46,7 @@ | ||
49 | gpointer invocation_hint, | ||
50 | gpointer marshal_data); | ||
51 | |||
52 | -/* BOOLEAN:OBJECT,UINT,FLAGS (./gtkmarshalers.list:29) */ | ||
53 | +/* BOOLEAN:OBJECT,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:29) */ | ||
54 | extern void _gtk_marshal_BOOLEAN__OBJECT_UINT_FLAGS (GClosure *closure, | ||
55 | GValue *return_value, | ||
56 | guint n_param_values, | ||
57 | @@ -54,7 +54,7 @@ | ||
58 | gpointer invocation_hint, | ||
59 | gpointer marshal_data); | ||
60 | |||
61 | -/* BOOLEAN:OBJECT,INT,INT,UINT (./gtkmarshalers.list:30) */ | ||
62 | +/* BOOLEAN:OBJECT,INT,INT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:30) */ | ||
63 | extern void _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT (GClosure *closure, | ||
64 | GValue *return_value, | ||
65 | guint n_param_values, | ||
66 | @@ -62,7 +62,7 @@ | ||
67 | gpointer invocation_hint, | ||
68 | gpointer marshal_data); | ||
69 | |||
70 | -/* BOOLEAN:OBJECT,STRING,STRING,BOXED (./gtkmarshalers.list:31) */ | ||
71 | +/* BOOLEAN:OBJECT,STRING,STRING,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:31) */ | ||
72 | extern void _gtk_marshal_BOOLEAN__OBJECT_STRING_STRING_BOXED (GClosure *closure, | ||
73 | GValue *return_value, | ||
74 | guint n_param_values, | ||
75 | @@ -70,7 +70,7 @@ | ||
76 | gpointer invocation_hint, | ||
77 | gpointer marshal_data); | ||
78 | |||
79 | -/* BOOLEAN:OBJECT,BOXED (./gtkmarshalers.list:32) */ | ||
80 | +/* BOOLEAN:OBJECT,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:32) */ | ||
81 | extern void _gtk_marshal_BOOLEAN__OBJECT_BOXED (GClosure *closure, | ||
82 | GValue *return_value, | ||
83 | guint n_param_values, | ||
84 | @@ -78,7 +78,7 @@ | ||
85 | gpointer invocation_hint, | ||
86 | gpointer marshal_data); | ||
87 | |||
88 | -/* BOOLEAN:OBJECT,BOXED,BOXED (./gtkmarshalers.list:33) */ | ||
89 | +/* BOOLEAN:OBJECT,BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:33) */ | ||
90 | extern void _gtk_marshal_BOOLEAN__OBJECT_BOXED_BOXED (GClosure *closure, | ||
91 | GValue *return_value, | ||
92 | guint n_param_values, | ||
93 | @@ -86,7 +86,7 @@ | ||
94 | gpointer invocation_hint, | ||
95 | gpointer marshal_data); | ||
96 | |||
97 | -/* BOOLEAN:OBJECT,STRING,STRING (./gtkmarshalers.list:34) */ | ||
98 | +/* BOOLEAN:OBJECT,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:34) */ | ||
99 | extern void _gtk_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure *closure, | ||
100 | GValue *return_value, | ||
101 | guint n_param_values, | ||
102 | @@ -94,7 +94,7 @@ | ||
103 | gpointer invocation_hint, | ||
104 | gpointer marshal_data); | ||
105 | |||
106 | -/* BOOLEAN:INT,INT (./gtkmarshalers.list:35) */ | ||
107 | +/* BOOLEAN:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:35) */ | ||
108 | extern void _gtk_marshal_BOOLEAN__INT_INT (GClosure *closure, | ||
109 | GValue *return_value, | ||
110 | guint n_param_values, | ||
111 | @@ -102,7 +102,7 @@ | ||
112 | gpointer invocation_hint, | ||
113 | gpointer marshal_data); | ||
114 | |||
115 | -/* BOOLEAN:INT,INT,INT (./gtkmarshalers.list:36) */ | ||
116 | +/* BOOLEAN:INT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:36) */ | ||
117 | extern void _gtk_marshal_BOOLEAN__INT_INT_INT (GClosure *closure, | ||
118 | GValue *return_value, | ||
119 | guint n_param_values, | ||
120 | @@ -110,7 +110,7 @@ | ||
121 | gpointer invocation_hint, | ||
122 | gpointer marshal_data); | ||
123 | |||
124 | -/* BOOLEAN:UINT (./gtkmarshalers.list:37) */ | ||
125 | +/* BOOLEAN:UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:37) */ | ||
126 | extern void _gtk_marshal_BOOLEAN__UINT (GClosure *closure, | ||
127 | GValue *return_value, | ||
128 | guint n_param_values, | ||
129 | @@ -118,7 +118,7 @@ | ||
130 | gpointer invocation_hint, | ||
131 | gpointer marshal_data); | ||
132 | |||
133 | -/* BOOLEAN:VOID (./gtkmarshalers.list:38) */ | ||
134 | +/* BOOLEAN:VOID (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:38) */ | ||
135 | extern void _gtk_marshal_BOOLEAN__VOID (GClosure *closure, | ||
136 | GValue *return_value, | ||
137 | guint n_param_values, | ||
138 | @@ -126,7 +126,7 @@ | ||
139 | gpointer invocation_hint, | ||
140 | gpointer marshal_data); | ||
141 | |||
142 | -/* BOOLEAN:BOOLEAN (./gtkmarshalers.list:39) */ | ||
143 | +/* BOOLEAN:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:39) */ | ||
144 | extern void _gtk_marshal_BOOLEAN__BOOLEAN (GClosure *closure, | ||
145 | GValue *return_value, | ||
146 | guint n_param_values, | ||
147 | @@ -134,10 +134,10 @@ | ||
148 | gpointer invocation_hint, | ||
149 | gpointer marshal_data); | ||
150 | |||
151 | -/* BOOLEAN:NONE (./gtkmarshalers.list:40) */ | ||
152 | +/* BOOLEAN:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:40) */ | ||
153 | #define _gtk_marshal_BOOLEAN__NONE _gtk_marshal_BOOLEAN__VOID | ||
154 | |||
155 | -/* BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN (./gtkmarshalers.list:41) */ | ||
156 | +/* BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:41) */ | ||
157 | extern void _gtk_marshal_BOOLEAN__BOOLEAN_BOOLEAN_BOOLEAN (GClosure *closure, | ||
158 | GValue *return_value, | ||
159 | guint n_param_values, | ||
160 | @@ -145,7 +145,7 @@ | ||
161 | gpointer invocation_hint, | ||
162 | gpointer marshal_data); | ||
163 | |||
164 | -/* BOOLEAN:STRING (./gtkmarshalers.list:42) */ | ||
165 | +/* BOOLEAN:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:42) */ | ||
166 | extern void _gtk_marshal_BOOLEAN__STRING (GClosure *closure, | ||
167 | GValue *return_value, | ||
168 | guint n_param_values, | ||
169 | @@ -153,7 +153,7 @@ | ||
170 | gpointer invocation_hint, | ||
171 | gpointer marshal_data); | ||
172 | |||
173 | -/* ENUM:ENUM (./gtkmarshalers.list:43) */ | ||
174 | +/* ENUM:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:43) */ | ||
175 | extern void _gtk_marshal_ENUM__ENUM (GClosure *closure, | ||
176 | GValue *return_value, | ||
177 | guint n_param_values, | ||
178 | @@ -161,7 +161,7 @@ | ||
179 | gpointer invocation_hint, | ||
180 | gpointer marshal_data); | ||
181 | |||
182 | -/* INT:POINTER (./gtkmarshalers.list:44) */ | ||
183 | +/* INT:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:44) */ | ||
184 | extern void _gtk_marshal_INT__POINTER (GClosure *closure, | ||
185 | GValue *return_value, | ||
186 | guint n_param_values, | ||
187 | @@ -169,19 +169,19 @@ | ||
188 | gpointer invocation_hint, | ||
189 | gpointer marshal_data); | ||
190 | |||
191 | -/* NONE:BOOLEAN (./gtkmarshalers.list:45) */ | ||
192 | +/* NONE:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:45) */ | ||
193 | #define _gtk_marshal_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN | ||
194 | #define _gtk_marshal_NONE__BOOLEAN _gtk_marshal_VOID__BOOLEAN | ||
195 | |||
196 | -/* NONE:ENUM (./gtkmarshalers.list:46) */ | ||
197 | +/* NONE:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:46) */ | ||
198 | #define _gtk_marshal_VOID__ENUM g_cclosure_marshal_VOID__ENUM | ||
199 | #define _gtk_marshal_NONE__ENUM _gtk_marshal_VOID__ENUM | ||
200 | |||
201 | -/* NONE:INT (./gtkmarshalers.list:47) */ | ||
202 | +/* NONE:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:47) */ | ||
203 | #define _gtk_marshal_VOID__INT g_cclosure_marshal_VOID__INT | ||
204 | #define _gtk_marshal_NONE__INT _gtk_marshal_VOID__INT | ||
205 | |||
206 | -/* NONE:INT,BOOL (./gtkmarshalers.list:48) */ | ||
207 | +/* NONE:INT,BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:48) */ | ||
208 | extern void _gtk_marshal_VOID__INT_BOOLEAN (GClosure *closure, | ||
209 | GValue *return_value, | ||
210 | guint n_param_values, | ||
211 | @@ -190,7 +190,7 @@ | ||
212 | gpointer marshal_data); | ||
213 | #define _gtk_marshal_NONE__INT_BOOL _gtk_marshal_VOID__INT_BOOLEAN | ||
214 | |||
215 | -/* NONE:INT,INT (./gtkmarshalers.list:49) */ | ||
216 | +/* NONE:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:49) */ | ||
217 | extern void _gtk_marshal_VOID__INT_INT (GClosure *closure, | ||
218 | GValue *return_value, | ||
219 | guint n_param_values, | ||
220 | @@ -199,11 +199,11 @@ | ||
221 | gpointer marshal_data); | ||
222 | #define _gtk_marshal_NONE__INT_INT _gtk_marshal_VOID__INT_INT | ||
223 | |||
224 | -/* NONE:NONE (./gtkmarshalers.list:50) */ | ||
225 | +/* NONE:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:50) */ | ||
226 | #define _gtk_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID | ||
227 | #define _gtk_marshal_NONE__NONE _gtk_marshal_VOID__VOID | ||
228 | |||
229 | -/* NONE:STRING,INT,POINTER (./gtkmarshalers.list:51) */ | ||
230 | +/* NONE:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:51) */ | ||
231 | extern void _gtk_marshal_VOID__STRING_INT_POINTER (GClosure *closure, | ||
232 | GValue *return_value, | ||
233 | guint n_param_values, | ||
234 | @@ -212,7 +212,7 @@ | ||
235 | gpointer marshal_data); | ||
236 | #define _gtk_marshal_NONE__STRING_INT_POINTER _gtk_marshal_VOID__STRING_INT_POINTER | ||
237 | |||
238 | -/* STRING:DOUBLE (./gtkmarshalers.list:52) */ | ||
239 | +/* STRING:DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:52) */ | ||
240 | extern void _gtk_marshal_STRING__DOUBLE (GClosure *closure, | ||
241 | GValue *return_value, | ||
242 | guint n_param_values, | ||
243 | @@ -220,12 +220,12 @@ | ||
244 | gpointer invocation_hint, | ||
245 | gpointer marshal_data); | ||
246 | |||
247 | -/* VOID:DOUBLE (./gtkmarshalers.list:53) */ | ||
248 | +/* VOID:DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:53) */ | ||
249 | #define _gtk_marshal_VOID__DOUBLE g_cclosure_marshal_VOID__DOUBLE | ||
250 | |||
251 | -/* VOID:BOOLEAN (./gtkmarshalers.list:54) */ | ||
252 | +/* VOID:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:54) */ | ||
253 | |||
254 | -/* VOID:BOOLEAN,BOOLEAN,BOOLEAN (./gtkmarshalers.list:55) */ | ||
255 | +/* VOID:BOOLEAN,BOOLEAN,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:55) */ | ||
256 | extern void _gtk_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN (GClosure *closure, | ||
257 | GValue *return_value, | ||
258 | guint n_param_values, | ||
259 | @@ -233,10 +233,10 @@ | ||
260 | gpointer invocation_hint, | ||
261 | gpointer marshal_data); | ||
262 | |||
263 | -/* VOID:BOXED (./gtkmarshalers.list:56) */ | ||
264 | +/* VOID:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:56) */ | ||
265 | #define _gtk_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED | ||
266 | |||
267 | -/* VOID:BOXED,BOXED (./gtkmarshalers.list:57) */ | ||
268 | +/* VOID:BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:57) */ | ||
269 | extern void _gtk_marshal_VOID__BOXED_BOXED (GClosure *closure, | ||
270 | GValue *return_value, | ||
271 | guint n_param_values, | ||
272 | @@ -244,7 +244,7 @@ | ||
273 | gpointer invocation_hint, | ||
274 | gpointer marshal_data); | ||
275 | |||
276 | -/* VOID:BOXED,BOXED,POINTER (./gtkmarshalers.list:58) */ | ||
277 | +/* VOID:BOXED,BOXED,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:58) */ | ||
278 | extern void _gtk_marshal_VOID__BOXED_BOXED_POINTER (GClosure *closure, | ||
279 | GValue *return_value, | ||
280 | guint n_param_values, | ||
281 | @@ -252,7 +252,7 @@ | ||
282 | gpointer invocation_hint, | ||
283 | gpointer marshal_data); | ||
284 | |||
285 | -/* VOID:BOXED,OBJECT (./gtkmarshalers.list:59) */ | ||
286 | +/* VOID:BOXED,OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:59) */ | ||
287 | extern void _gtk_marshal_VOID__BOXED_OBJECT (GClosure *closure, | ||
288 | GValue *return_value, | ||
289 | guint n_param_values, | ||
290 | @@ -260,7 +260,7 @@ | ||
291 | gpointer invocation_hint, | ||
292 | gpointer marshal_data); | ||
293 | |||
294 | -/* VOID:BOXED,STRING,INT (./gtkmarshalers.list:60) */ | ||
295 | +/* VOID:BOXED,STRING,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:60) */ | ||
296 | extern void _gtk_marshal_VOID__BOXED_STRING_INT (GClosure *closure, | ||
297 | GValue *return_value, | ||
298 | guint n_param_values, | ||
299 | @@ -268,7 +268,7 @@ | ||
300 | gpointer invocation_hint, | ||
301 | gpointer marshal_data); | ||
302 | |||
303 | -/* VOID:BOXED,UINT (./gtkmarshalers.list:61) */ | ||
304 | +/* VOID:BOXED,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:61) */ | ||
305 | extern void _gtk_marshal_VOID__BOXED_UINT (GClosure *closure, | ||
306 | GValue *return_value, | ||
307 | guint n_param_values, | ||
308 | @@ -276,7 +276,7 @@ | ||
309 | gpointer invocation_hint, | ||
310 | gpointer marshal_data); | ||
311 | |||
312 | -/* VOID:BOXED,UINT,FLAGS (./gtkmarshalers.list:62) */ | ||
313 | +/* VOID:BOXED,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:62) */ | ||
314 | extern void _gtk_marshal_VOID__BOXED_UINT_FLAGS (GClosure *closure, | ||
315 | GValue *return_value, | ||
316 | guint n_param_values, | ||
317 | @@ -284,7 +284,7 @@ | ||
318 | gpointer invocation_hint, | ||
319 | gpointer marshal_data); | ||
320 | |||
321 | -/* VOID:BOXED,UINT,UINT (./gtkmarshalers.list:63) */ | ||
322 | +/* VOID:BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:63) */ | ||
323 | extern void _gtk_marshal_VOID__BOXED_UINT_UINT (GClosure *closure, | ||
324 | GValue *return_value, | ||
325 | guint n_param_values, | ||
326 | @@ -292,9 +292,9 @@ | ||
327 | gpointer invocation_hint, | ||
328 | gpointer marshal_data); | ||
329 | |||
330 | -/* VOID:ENUM (./gtkmarshalers.list:64) */ | ||
331 | +/* VOID:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:64) */ | ||
332 | |||
333 | -/* VOID:ENUM,BOOLEAN (./gtkmarshalers.list:65) */ | ||
334 | +/* VOID:ENUM,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:65) */ | ||
335 | extern void _gtk_marshal_VOID__ENUM_BOOLEAN (GClosure *closure, | ||
336 | GValue *return_value, | ||
337 | guint n_param_values, | ||
338 | @@ -302,7 +302,7 @@ | ||
339 | gpointer invocation_hint, | ||
340 | gpointer marshal_data); | ||
341 | |||
342 | -/* VOID:ENUM,ENUM (./gtkmarshalers.list:66) */ | ||
343 | +/* VOID:ENUM,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:66) */ | ||
344 | extern void _gtk_marshal_VOID__ENUM_ENUM (GClosure *closure, | ||
345 | GValue *return_value, | ||
346 | guint n_param_values, | ||
347 | @@ -310,7 +310,7 @@ | ||
348 | gpointer invocation_hint, | ||
349 | gpointer marshal_data); | ||
350 | |||
351 | -/* VOID:ENUM,FLOAT (./gtkmarshalers.list:67) */ | ||
352 | +/* VOID:ENUM,FLOAT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:67) */ | ||
353 | extern void _gtk_marshal_VOID__ENUM_FLOAT (GClosure *closure, | ||
354 | GValue *return_value, | ||
355 | guint n_param_values, | ||
356 | @@ -318,7 +318,7 @@ | ||
357 | gpointer invocation_hint, | ||
358 | gpointer marshal_data); | ||
359 | |||
360 | -/* VOID:ENUM,FLOAT,BOOLEAN (./gtkmarshalers.list:68) */ | ||
361 | +/* VOID:ENUM,FLOAT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:68) */ | ||
362 | extern void _gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure *closure, | ||
363 | GValue *return_value, | ||
364 | guint n_param_values, | ||
365 | @@ -326,7 +326,7 @@ | ||
366 | gpointer invocation_hint, | ||
367 | gpointer marshal_data); | ||
368 | |||
369 | -/* VOID:ENUM,INT (./gtkmarshalers.list:69) */ | ||
370 | +/* VOID:ENUM,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:69) */ | ||
371 | extern void _gtk_marshal_VOID__ENUM_INT (GClosure *closure, | ||
372 | GValue *return_value, | ||
373 | guint n_param_values, | ||
374 | @@ -334,7 +334,7 @@ | ||
375 | gpointer invocation_hint, | ||
376 | gpointer marshal_data); | ||
377 | |||
378 | -/* VOID:ENUM,INT,BOOLEAN (./gtkmarshalers.list:70) */ | ||
379 | +/* VOID:ENUM,INT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:70) */ | ||
380 | extern void _gtk_marshal_VOID__ENUM_INT_BOOLEAN (GClosure *closure, | ||
381 | GValue *return_value, | ||
382 | guint n_param_values, | ||
383 | @@ -342,11 +342,11 @@ | ||
384 | gpointer invocation_hint, | ||
385 | gpointer marshal_data); | ||
386 | |||
387 | -/* VOID:INT (./gtkmarshalers.list:71) */ | ||
388 | +/* VOID:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:71) */ | ||
389 | |||
390 | -/* VOID:INT,INT (./gtkmarshalers.list:72) */ | ||
391 | +/* VOID:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:72) */ | ||
392 | |||
393 | -/* VOID:INT,INT,BOXED (./gtkmarshalers.list:73) */ | ||
394 | +/* VOID:INT,INT,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:73) */ | ||
395 | extern void _gtk_marshal_VOID__INT_INT_BOXED (GClosure *closure, | ||
396 | GValue *return_value, | ||
397 | guint n_param_values, | ||
398 | @@ -354,7 +354,7 @@ | ||
399 | gpointer invocation_hint, | ||
400 | gpointer marshal_data); | ||
401 | |||
402 | -/* VOID:INT,INT,INT (./gtkmarshalers.list:74) */ | ||
403 | +/* VOID:INT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:74) */ | ||
404 | extern void _gtk_marshal_VOID__INT_INT_INT (GClosure *closure, | ||
405 | GValue *return_value, | ||
406 | guint n_param_values, | ||
407 | @@ -362,10 +362,10 @@ | ||
408 | gpointer invocation_hint, | ||
409 | gpointer marshal_data); | ||
410 | |||
411 | -/* VOID:OBJECT (./gtkmarshalers.list:75) */ | ||
412 | +/* VOID:OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:75) */ | ||
413 | #define _gtk_marshal_VOID__OBJECT g_cclosure_marshal_VOID__OBJECT | ||
414 | |||
415 | -/* VOID:OBJECT,BOOLEAN (./gtkmarshalers.list:76) */ | ||
416 | +/* VOID:OBJECT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:76) */ | ||
417 | extern void _gtk_marshal_VOID__OBJECT_BOOLEAN (GClosure *closure, | ||
418 | GValue *return_value, | ||
419 | guint n_param_values, | ||
420 | @@ -373,7 +373,7 @@ | ||
421 | gpointer invocation_hint, | ||
422 | gpointer marshal_data); | ||
423 | |||
424 | -/* VOID:OBJECT,BOXED,BOXED (./gtkmarshalers.list:77) */ | ||
425 | +/* VOID:OBJECT,BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:77) */ | ||
426 | extern void _gtk_marshal_VOID__OBJECT_BOXED_BOXED (GClosure *closure, | ||
427 | GValue *return_value, | ||
428 | guint n_param_values, | ||
429 | @@ -381,7 +381,7 @@ | ||
430 | gpointer invocation_hint, | ||
431 | gpointer marshal_data); | ||
432 | |||
433 | -/* VOID:OBJECT,BOXED,UINT,UINT (./gtkmarshalers.list:78) */ | ||
434 | +/* VOID:OBJECT,BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:78) */ | ||
435 | extern void _gtk_marshal_VOID__OBJECT_BOXED_UINT_UINT (GClosure *closure, | ||
436 | GValue *return_value, | ||
437 | guint n_param_values, | ||
438 | @@ -389,7 +389,7 @@ | ||
439 | gpointer invocation_hint, | ||
440 | gpointer marshal_data); | ||
441 | |||
442 | -/* VOID:OBJECT,INT,INT (./gtkmarshalers.list:79) */ | ||
443 | +/* VOID:OBJECT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:79) */ | ||
444 | extern void _gtk_marshal_VOID__OBJECT_INT_INT (GClosure *closure, | ||
445 | GValue *return_value, | ||
446 | guint n_param_values, | ||
447 | @@ -397,7 +397,7 @@ | ||
448 | gpointer invocation_hint, | ||
449 | gpointer marshal_data); | ||
450 | |||
451 | -/* VOID:OBJECT,INT,INT,BOXED,UINT,UINT (./gtkmarshalers.list:80) */ | ||
452 | +/* VOID:OBJECT,INT,INT,BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:80) */ | ||
453 | extern void _gtk_marshal_VOID__OBJECT_INT_INT_BOXED_UINT_UINT (GClosure *closure, | ||
454 | GValue *return_value, | ||
455 | guint n_param_values, | ||
456 | @@ -405,7 +405,7 @@ | ||
457 | gpointer invocation_hint, | ||
458 | gpointer marshal_data); | ||
459 | |||
460 | -/* VOID:OBJECT,OBJECT (./gtkmarshalers.list:81) */ | ||
461 | +/* VOID:OBJECT,OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:81) */ | ||
462 | extern void _gtk_marshal_VOID__OBJECT_OBJECT (GClosure *closure, | ||
463 | GValue *return_value, | ||
464 | guint n_param_values, | ||
465 | @@ -413,7 +413,7 @@ | ||
466 | gpointer invocation_hint, | ||
467 | gpointer marshal_data); | ||
468 | |||
469 | -/* VOID:OBJECT,STRING (./gtkmarshalers.list:82) */ | ||
470 | +/* VOID:OBJECT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:82) */ | ||
471 | extern void _gtk_marshal_VOID__OBJECT_STRING (GClosure *closure, | ||
472 | GValue *return_value, | ||
473 | guint n_param_values, | ||
474 | @@ -421,7 +421,7 @@ | ||
475 | gpointer invocation_hint, | ||
476 | gpointer marshal_data); | ||
477 | |||
478 | -/* VOID:OBJECT,STRING,STRING (./gtkmarshalers.list:83) */ | ||
479 | +/* VOID:OBJECT,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:83) */ | ||
480 | extern void _gtk_marshal_VOID__OBJECT_STRING_STRING (GClosure *closure, | ||
481 | GValue *return_value, | ||
482 | guint n_param_values, | ||
483 | @@ -429,7 +429,7 @@ | ||
484 | gpointer invocation_hint, | ||
485 | gpointer marshal_data); | ||
486 | |||
487 | -/* VOID:OBJECT,UINT (./gtkmarshalers.list:84) */ | ||
488 | +/* VOID:OBJECT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:84) */ | ||
489 | extern void _gtk_marshal_VOID__OBJECT_UINT (GClosure *closure, | ||
490 | GValue *return_value, | ||
491 | guint n_param_values, | ||
492 | @@ -437,7 +437,7 @@ | ||
493 | gpointer invocation_hint, | ||
494 | gpointer marshal_data); | ||
495 | |||
496 | -/* VOID:OBJECT,UINT,FLAGS (./gtkmarshalers.list:85) */ | ||
497 | +/* VOID:OBJECT,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:85) */ | ||
498 | extern void _gtk_marshal_VOID__OBJECT_UINT_FLAGS (GClosure *closure, | ||
499 | GValue *return_value, | ||
500 | guint n_param_values, | ||
501 | @@ -445,12 +445,12 @@ | ||
502 | gpointer invocation_hint, | ||
503 | gpointer marshal_data); | ||
504 | |||
505 | -/* VOID:OBJECT,STRING (./gtkmarshalers.list:86) */ | ||
506 | +/* VOID:OBJECT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:86) */ | ||
507 | |||
508 | -/* VOID:POINTER (./gtkmarshalers.list:87) */ | ||
509 | +/* VOID:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:87) */ | ||
510 | #define _gtk_marshal_VOID__POINTER g_cclosure_marshal_VOID__POINTER | ||
511 | |||
512 | -/* VOID:POINTER,INT (./gtkmarshalers.list:88) */ | ||
513 | +/* VOID:POINTER,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:88) */ | ||
514 | extern void _gtk_marshal_VOID__POINTER_INT (GClosure *closure, | ||
515 | GValue *return_value, | ||
516 | guint n_param_values, | ||
517 | @@ -458,7 +458,7 @@ | ||
518 | gpointer invocation_hint, | ||
519 | gpointer marshal_data); | ||
520 | |||
521 | -/* VOID:POINTER,BOOLEAN (./gtkmarshalers.list:89) */ | ||
522 | +/* VOID:POINTER,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:89) */ | ||
523 | extern void _gtk_marshal_VOID__POINTER_BOOLEAN (GClosure *closure, | ||
524 | GValue *return_value, | ||
525 | guint n_param_values, | ||
526 | @@ -466,7 +466,7 @@ | ||
527 | gpointer invocation_hint, | ||
528 | gpointer marshal_data); | ||
529 | |||
530 | -/* VOID:POINTER,POINTER,POINTER (./gtkmarshalers.list:90) */ | ||
531 | +/* VOID:POINTER,POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:90) */ | ||
532 | extern void _gtk_marshal_VOID__POINTER_POINTER_POINTER (GClosure *closure, | ||
533 | GValue *return_value, | ||
534 | guint n_param_values, | ||
535 | @@ -474,7 +474,7 @@ | ||
536 | gpointer invocation_hint, | ||
537 | gpointer marshal_data); | ||
538 | |||
539 | -/* VOID:POINTER,UINT (./gtkmarshalers.list:91) */ | ||
540 | +/* VOID:POINTER,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:91) */ | ||
541 | extern void _gtk_marshal_VOID__POINTER_UINT (GClosure *closure, | ||
542 | GValue *return_value, | ||
543 | guint n_param_values, | ||
544 | @@ -482,10 +482,10 @@ | ||
545 | gpointer invocation_hint, | ||
546 | gpointer marshal_data); | ||
547 | |||
548 | -/* VOID:STRING (./gtkmarshalers.list:92) */ | ||
549 | +/* VOID:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:92) */ | ||
550 | #define _gtk_marshal_VOID__STRING g_cclosure_marshal_VOID__STRING | ||
551 | |||
552 | -/* VOID:STRING,STRING (./gtkmarshalers.list:93) */ | ||
553 | +/* VOID:STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:93) */ | ||
554 | extern void _gtk_marshal_VOID__STRING_STRING (GClosure *closure, | ||
555 | GValue *return_value, | ||
556 | guint n_param_values, | ||
557 | @@ -493,9 +493,9 @@ | ||
558 | gpointer invocation_hint, | ||
559 | gpointer marshal_data); | ||
560 | |||
561 | -/* VOID:STRING,INT,POINTER (./gtkmarshalers.list:94) */ | ||
562 | +/* VOID:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:94) */ | ||
563 | |||
564 | -/* VOID:STRING,UINT,FLAGS (./gtkmarshalers.list:95) */ | ||
565 | +/* VOID:STRING,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:95) */ | ||
566 | extern void _gtk_marshal_VOID__STRING_UINT_FLAGS (GClosure *closure, | ||
567 | GValue *return_value, | ||
568 | guint n_param_values, | ||
569 | @@ -503,7 +503,7 @@ | ||
570 | gpointer invocation_hint, | ||
571 | gpointer marshal_data); | ||
572 | |||
573 | -/* VOID:UINT,FLAGS,BOXED (./gtkmarshalers.list:96) */ | ||
574 | +/* VOID:UINT,FLAGS,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:96) */ | ||
575 | extern void _gtk_marshal_VOID__UINT_FLAGS_BOXED (GClosure *closure, | ||
576 | GValue *return_value, | ||
577 | guint n_param_values, | ||
578 | @@ -511,7 +511,7 @@ | ||
579 | gpointer invocation_hint, | ||
580 | gpointer marshal_data); | ||
581 | |||
582 | -/* VOID:UINT,UINT (./gtkmarshalers.list:97) */ | ||
583 | +/* VOID:UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:97) */ | ||
584 | extern void _gtk_marshal_VOID__UINT_UINT (GClosure *closure, | ||
585 | GValue *return_value, | ||
586 | guint n_param_values, | ||
587 | @@ -519,7 +519,7 @@ | ||
588 | gpointer invocation_hint, | ||
589 | gpointer marshal_data); | ||
590 | |||
591 | -/* VOID:UINT,STRING (./gtkmarshalers.list:98) */ | ||
592 | +/* VOID:UINT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:98) */ | ||
593 | extern void _gtk_marshal_VOID__UINT_STRING (GClosure *closure, | ||
594 | GValue *return_value, | ||
595 | guint n_param_values, | ||
596 | @@ -527,7 +527,7 @@ | ||
597 | gpointer invocation_hint, | ||
598 | gpointer marshal_data); | ||
599 | |||
600 | -/* VOID:UINT,BOXED,UINT,FLAGS,FLAGS (./gtkmarshalers.list:99) */ | ||
601 | +/* VOID:UINT,BOXED,UINT,FLAGS,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:99) */ | ||
602 | extern void _gtk_marshal_VOID__UINT_BOXED_UINT_FLAGS_FLAGS (GClosure *closure, | ||
603 | GValue *return_value, | ||
604 | guint n_param_values, | ||
605 | @@ -535,7 +535,7 @@ | ||
606 | gpointer invocation_hint, | ||
607 | gpointer marshal_data); | ||
608 | |||
609 | -/* VOID:UINT,OBJECT,UINT,FLAGS,FLAGS (./gtkmarshalers.list:100) */ | ||
610 | +/* VOID:UINT,OBJECT,UINT,FLAGS,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:100) */ | ||
611 | extern void _gtk_marshal_VOID__UINT_OBJECT_UINT_FLAGS_FLAGS (GClosure *closure, | ||
612 | GValue *return_value, | ||
613 | guint n_param_values, | ||
614 | @@ -543,7 +543,7 @@ | ||
615 | gpointer invocation_hint, | ||
616 | gpointer marshal_data); | ||
617 | |||
618 | -/* VOID:VOID (./gtkmarshalers.list:101) */ | ||
619 | +/* VOID:VOID (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:101) */ | ||
620 | |||
621 | G_END_DECLS | ||
622 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenu.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenu.c.diff deleted file mode 100644 index 16fac1b155..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenu.c.diff +++ /dev/null | |||
@@ -1,1223 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmenu.c 2005-03-01 08:28:56.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmenu.c 2005-04-06 16:19:36.921925376 +0300 | ||
3 | @@ -24,10 +24,16 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | #define GTK_MENU_INTERNALS | ||
12 | |||
13 | #include <config.h> | ||
14 | #include <string.h> /* memset */ | ||
15 | +#include <math.h> | ||
16 | +#include <stdlib.h> | ||
17 | #include "gdk/gdkkeysyms.h" | ||
18 | #include "gtkalias.h" | ||
19 | #include "gtkaccellabel.h" | ||
20 | @@ -44,7 +50,11 @@ | ||
21 | #include "gtkvscrollbar.h" | ||
22 | #include "gtksettings.h" | ||
23 | #include "gtkintl.h" | ||
24 | +#include "gtkcombobox.h" | ||
25 | |||
26 | +/* Hildon : We need this to figure out if menu should have | ||
27 | + * corners etc. */ | ||
28 | +#include "gtkmenubar.h" | ||
29 | |||
30 | #define MENU_ITEM_CLASS(w) GTK_MENU_ITEM_GET_CLASS (w) | ||
31 | |||
32 | @@ -55,16 +65,43 @@ | ||
33 | * extends below the submenu | ||
34 | */ | ||
35 | |||
36 | +/* HILDON: | ||
37 | + * Urgh, nasty thing to hard-code things like these :p | ||
38 | + * One should really do some rewriting here... | ||
39 | + */ | ||
40 | + | ||
41 | #define MENU_SCROLL_STEP1 8 | ||
42 | #define MENU_SCROLL_STEP2 15 | ||
43 | -#define MENU_SCROLL_ARROW_HEIGHT 16 | ||
44 | -#define MENU_SCROLL_FAST_ZONE 8 | ||
45 | +#define MENU_SCROLL_ARROW_HEIGHT 20 /* This used to be: 23; This hard-coding should be | ||
46 | + * changed. Add arrow_height style property into | ||
47 | + * commongtkrc and read it from there everywhere | ||
48 | + * where a reference to MENU_SCROLL_ARROW_HEIGHT | ||
49 | + * is made. | ||
50 | + * If these changes are made, please modify also | ||
51 | + * gtkcombobox.c. | ||
52 | + */ | ||
53 | +#define MENU_SCROLL_FAST_ZONE MENU_SCROLL_ARROW_HEIGHT /* Was originally 8 */ | ||
54 | #define MENU_SCROLL_TIMEOUT1 50 | ||
55 | #define MENU_SCROLL_TIMEOUT2 20 | ||
56 | |||
57 | #define ATTACH_INFO_KEY "gtk-menu-child-attach-info-key" | ||
58 | #define ATTACHED_MENUS "gtk-attached-menus" | ||
59 | |||
60 | +/* HILDON: */ | ||
61 | +#define HILDON_MENU_NAME_SHARP "menu_with_corners" | ||
62 | + | ||
63 | +/* needed to allow different themeing for first level menus */ | ||
64 | +#define HILDON_MENU_NAME_ROUND_FIRST_LEVEL "menu_without_corners_first_level" | ||
65 | +#define HILDON_MENU_NAME_ROUND "menu_without_corners" | ||
66 | +#define HILDON_MENU_NAME_FORCE_SHARP "menu_force_with_corners" | ||
67 | +#define HILDON_MENU_NAME_FORCE_ROUND "menu_force_without_corners" | ||
68 | + | ||
69 | +/* maximum sizes for menus when attached to comboboxes */ | ||
70 | +#define HILDON_MENU_COMBO_MAX_WIDTH 406 | ||
71 | +#define HILDON_MENU_COMBO_MIN_WIDTH 66 | ||
72 | +#define HILDON_MENU_COMBO_MAX_HEIGHT 305 | ||
73 | +#define HILDON_MENU_COMBO_MIN_HEIGHT 70 | ||
74 | + | ||
75 | typedef struct _GtkMenuAttachData GtkMenuAttachData; | ||
76 | typedef struct _GtkMenuPrivate GtkMenuPrivate; | ||
77 | |||
78 | @@ -92,6 +129,15 @@ | ||
79 | gboolean have_layout; | ||
80 | gint n_rows; | ||
81 | gint n_columns; | ||
82 | + | ||
83 | + /* Arrow states */ | ||
84 | + GtkStateType lower_arrow_state; | ||
85 | + GtkStateType upper_arrow_state; | ||
86 | + | ||
87 | + /* For context menu behavior */ | ||
88 | + gboolean context_menu; | ||
89 | + int popup_pointer_x; | ||
90 | + int popup_pointer_y; | ||
91 | }; | ||
92 | |||
93 | typedef struct | ||
94 | @@ -108,6 +154,7 @@ | ||
95 | |||
96 | enum { | ||
97 | MOVE_SCROLL, | ||
98 | + CLOSE_CURRENT, | ||
99 | LAST_SIGNAL | ||
100 | }; | ||
101 | |||
102 | @@ -191,7 +238,8 @@ | ||
103 | static void gtk_menu_handle_scrolling (GtkMenu *menu, | ||
104 | gint event_x, | ||
105 | gint event_y, | ||
106 | - gboolean enter); | ||
107 | + gboolean enter, | ||
108 | + gboolean motion); | ||
109 | static void gtk_menu_set_tearoff_hints (GtkMenu *menu, | ||
110 | gint width); | ||
111 | static void gtk_menu_style_set (GtkWidget *widget, | ||
112 | @@ -232,6 +280,9 @@ | ||
113 | guint signal_id); | ||
114 | static void _gtk_menu_refresh_accel_paths (GtkMenu *menu, | ||
115 | gboolean group_changed); | ||
116 | +static gboolean gtk_menu_check_name (GtkWidget *widget); | ||
117 | + | ||
118 | +static void _gtk_menu_close_current (GtkMenu *menu); | ||
119 | |||
120 | static GtkMenuShellClass *parent_class = NULL; | ||
121 | static const gchar attach_data_key[] = "gtk-menu-attach-data"; | ||
122 | @@ -496,7 +547,6 @@ | ||
123 | widget_class->hide_all = gtk_menu_hide_all; | ||
124 | widget_class->enter_notify_event = gtk_menu_enter_notify; | ||
125 | widget_class->leave_notify_event = gtk_menu_leave_notify; | ||
126 | - widget_class->motion_notify_event = gtk_menu_motion_notify; | ||
127 | widget_class->style_set = gtk_menu_style_set; | ||
128 | widget_class->focus = gtk_menu_focus; | ||
129 | widget_class->can_activate_accel = gtk_menu_real_can_activate_accel; | ||
130 | @@ -521,6 +571,15 @@ | ||
131 | _gtk_marshal_VOID__ENUM, | ||
132 | G_TYPE_NONE, 1, | ||
133 | GTK_TYPE_SCROLL_TYPE); | ||
134 | + | ||
135 | + menu_signals[CLOSE_CURRENT] = | ||
136 | + _gtk_binding_signal_new ("close_current", | ||
137 | + G_OBJECT_CLASS_TYPE (object_class), | ||
138 | + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, | ||
139 | + G_CALLBACK (_gtk_menu_close_current), | ||
140 | + NULL, NULL, | ||
141 | + _gtk_marshal_VOID__VOID, | ||
142 | + G_TYPE_NONE, 0); | ||
143 | |||
144 | g_object_class_install_property (gobject_class, | ||
145 | PROP_TEAROFF_TITLE, | ||
146 | @@ -606,6 +665,11 @@ | ||
147 | G_PARAM_READWRITE)); | ||
148 | |||
149 | binding_set = gtk_binding_set_by_class (class); | ||
150 | + /* Hildon : We moved handling of escape-key here because we need it to | ||
151 | + * work like closing a submenu, not closing all the menus. */ | ||
152 | + gtk_binding_entry_add_signal (binding_set, | ||
153 | + GDK_Escape, 0, | ||
154 | + "close_current", 0); | ||
155 | gtk_binding_entry_add_signal (binding_set, | ||
156 | GDK_Up, 0, | ||
157 | "move_current", 1, | ||
158 | @@ -709,6 +773,25 @@ | ||
159 | DEFAULT_POPDOWN_DELAY, | ||
160 | G_PARAM_READWRITE)); | ||
161 | |||
162 | + /* Hildon addition : border width was | ||
163 | + replaced with horizontal-padding and | ||
164 | + vertical-padding (which already is an style | ||
165 | + property for GtkMenu). */ | ||
166 | + gtk_widget_class_install_style_property (widget_class, | ||
167 | + g_param_spec_int ("horizontal-padding", | ||
168 | + P_("Horizontal Padding"), | ||
169 | + P_("Extra space at the left and right edges of the menu"), | ||
170 | + 0, | ||
171 | + G_MAXINT, | ||
172 | + 0, /* 1, */ | ||
173 | + G_PARAM_READABLE)); | ||
174 | + | ||
175 | + gtk_widget_class_install_style_property (widget_class, | ||
176 | + g_param_spec_boolean ("double_arrows", | ||
177 | + P_("Double Arrows"), | ||
178 | + P_("When scrolling, always show both arrows."), | ||
179 | + FALSE, | ||
180 | + G_PARAM_READABLE)); | ||
181 | } | ||
182 | |||
183 | |||
184 | @@ -884,13 +967,14 @@ | ||
185 | menu->toggle_size = 0; | ||
186 | |||
187 | menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW, | ||
188 | - "type", GTK_WINDOW_POPUP, | ||
189 | - "child", menu, | ||
190 | - NULL), | ||
191 | + "type", GTK_WINDOW_POPUP, | ||
192 | + "child", menu, | ||
193 | + NULL), | ||
194 | "signal::event", gtk_menu_window_event, menu, | ||
195 | "signal::size_request", gtk_menu_window_size_request, menu, | ||
196 | "signal::destroy", gtk_widget_destroyed, &menu->toplevel, | ||
197 | NULL); | ||
198 | + | ||
199 | gtk_window_set_resizable (GTK_WINDOW (menu->toplevel), FALSE); | ||
200 | gtk_window_set_mnemonic_modifier (GTK_WINDOW (menu->toplevel), 0); | ||
201 | |||
202 | @@ -919,6 +1003,15 @@ | ||
203 | menu->lower_arrow_visible = FALSE; | ||
204 | menu->upper_arrow_prelight = FALSE; | ||
205 | menu->lower_arrow_prelight = FALSE; | ||
206 | + | ||
207 | + /* <Hildon> */ | ||
208 | + priv->upper_arrow_state = GTK_STATE_NORMAL; | ||
209 | + priv->lower_arrow_state = GTK_STATE_NORMAL; | ||
210 | + | ||
211 | + priv->context_menu = FALSE; | ||
212 | + priv->popup_pointer_x = -1; | ||
213 | + priv->popup_pointer_y = -1; | ||
214 | + /* </hildon */ | ||
215 | |||
216 | priv->have_layout = FALSE; | ||
217 | } | ||
218 | @@ -1220,7 +1313,8 @@ | ||
219 | |||
220 | static gboolean | ||
221 | popup_grab_on_window (GdkWindow *window, | ||
222 | - guint32 activate_time) | ||
223 | + guint32 activate_time, | ||
224 | + gboolean grab_keyboard) | ||
225 | { | ||
226 | if ((gdk_pointer_grab (window, TRUE, | ||
227 | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | | ||
228 | @@ -1228,7 +1322,8 @@ | ||
229 | GDK_POINTER_MOTION_MASK, | ||
230 | NULL, NULL, activate_time) == 0)) | ||
231 | { | ||
232 | - if (gdk_keyboard_grab (window, TRUE, | ||
233 | + if (!grab_keyboard || | ||
234 | + gdk_keyboard_grab (window, TRUE, | ||
235 | activate_time) == 0) | ||
236 | return TRUE; | ||
237 | else | ||
238 | @@ -1282,6 +1377,7 @@ | ||
239 | GtkWidget *parent; | ||
240 | GdkEvent *current_event; | ||
241 | GtkMenuShell *menu_shell; | ||
242 | + gboolean grab_keyboard; | ||
243 | GtkMenuPrivate *priv = gtk_menu_get_private (menu); | ||
244 | |||
245 | g_return_if_fail (GTK_IS_MENU (menu)); | ||
246 | @@ -1333,10 +1429,28 @@ | ||
247 | * probably could just leave the grab on the other window, with a | ||
248 | * little reorganization of the code in gtkmenu*). | ||
249 | */ | ||
250 | + | ||
251 | + grab_keyboard = gtk_menu_shell_get_take_focus (menu_shell); | ||
252 | + gtk_window_set_accept_focus (GTK_WINDOW (menu->toplevel), grab_keyboard); | ||
253 | + | ||
254 | if (xgrab_shell && xgrab_shell != widget) | ||
255 | { | ||
256 | - if (popup_grab_on_window (xgrab_shell->window, activate_time)) | ||
257 | + if (popup_grab_on_window (xgrab_shell->window, activate_time, grab_keyboard)) | ||
258 | GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE; | ||
259 | + | ||
260 | + /* HILDON: | ||
261 | + * Check wheter parent is GtkMenuBar. If so, | ||
262 | + * then we need sharp upper corners for this menu. | ||
263 | + */ | ||
264 | + if (gtk_menu_check_name (widget)) | ||
265 | + { | ||
266 | + if (GTK_IS_MENU_BAR (parent_menu_shell)) | ||
267 | + gtk_widget_set_name (widget, HILDON_MENU_NAME_SHARP); | ||
268 | + else if (GTK_IS_MENU (parent_menu_shell)) | ||
269 | + gtk_widget_set_name( widget, HILDON_MENU_NAME_ROUND); | ||
270 | + else | ||
271 | + gtk_widget_set_name (widget, HILDON_MENU_NAME_ROUND_FIRST_LEVEL); | ||
272 | + } | ||
273 | } | ||
274 | else | ||
275 | { | ||
276 | @@ -1344,8 +1458,14 @@ | ||
277 | |||
278 | xgrab_shell = widget; | ||
279 | transfer_window = menu_grab_transfer_window_get (menu); | ||
280 | - if (popup_grab_on_window (transfer_window, activate_time)) | ||
281 | + if (popup_grab_on_window (transfer_window, activate_time, grab_keyboard)) | ||
282 | GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE; | ||
283 | + | ||
284 | + /* HILDON: | ||
285 | + * We want this menu to have round corners (Used by default) | ||
286 | + */ | ||
287 | + if (gtk_menu_check_name (widget)) | ||
288 | + gtk_widget_set_name (widget, HILDON_MENU_NAME_ROUND_FIRST_LEVEL); | ||
289 | } | ||
290 | |||
291 | if (!GTK_MENU_SHELL (xgrab_shell)->have_xgrab) | ||
292 | @@ -1409,6 +1529,23 @@ | ||
293 | |||
294 | /* Position the menu, possibly changing the size request | ||
295 | */ | ||
296 | + if (GTK_IS_COMBO_BOX (gtk_menu_get_attach_widget (menu))) | ||
297 | + { | ||
298 | + /* Hildon - limit the size if the menu is attached to a ComboBox */ | ||
299 | + GtkRequisition req; | ||
300 | + gint width, height; | ||
301 | + | ||
302 | + gtk_widget_set_size_request (widget, -1, -1); | ||
303 | + gtk_widget_size_request (widget, &req); | ||
304 | + | ||
305 | + width = MAX (MIN (req.width, HILDON_MENU_COMBO_MAX_WIDTH), | ||
306 | + HILDON_MENU_COMBO_MIN_WIDTH); | ||
307 | + height = MAX (MIN (req.height, HILDON_MENU_COMBO_MAX_HEIGHT), | ||
308 | + HILDON_MENU_COMBO_MIN_HEIGHT); | ||
309 | + | ||
310 | + gtk_widget_set_size_request (widget, width, height); | ||
311 | + } | ||
312 | + | ||
313 | gtk_menu_position (menu); | ||
314 | |||
315 | /* Compute the size of the toplevel and realize it so we | ||
316 | @@ -1430,13 +1567,29 @@ | ||
317 | |||
318 | gtk_menu_scroll_to (menu, menu->scroll_offset); | ||
319 | |||
320 | + if (priv->context_menu) | ||
321 | + { | ||
322 | + /* Save position of the pointer during popup */ | ||
323 | + /* currently not-multihead safe */ | ||
324 | + GdkScreen *screen; | ||
325 | + GdkDisplay *display; | ||
326 | + | ||
327 | + screen = gtk_widget_get_screen (widget); | ||
328 | + display = gdk_screen_get_display (screen); | ||
329 | + | ||
330 | + gdk_display_get_pointer (display, NULL, | ||
331 | + &priv->popup_pointer_x, | ||
332 | + &priv->popup_pointer_y, | ||
333 | + NULL); | ||
334 | + } | ||
335 | + | ||
336 | /* Once everything is set up correctly, map the toplevel window on | ||
337 | the screen. | ||
338 | */ | ||
339 | gtk_widget_show (menu->toplevel); | ||
340 | |||
341 | if (xgrab_shell == widget) | ||
342 | - popup_grab_on_window (widget->window, activate_time); /* Should always succeed */ | ||
343 | + popup_grab_on_window (widget->window, activate_time, grab_keyboard); /* Should always succeed */ | ||
344 | gtk_grab_add (GTK_WIDGET (menu)); | ||
345 | } | ||
346 | |||
347 | @@ -1996,6 +2149,7 @@ | ||
348 | GtkWidget *child; | ||
349 | GList *children; | ||
350 | guint vertical_padding; | ||
351 | + guint horizontal_padding; | ||
352 | |||
353 | g_return_if_fail (GTK_IS_MENU (widget)); | ||
354 | |||
355 | @@ -2025,9 +2179,10 @@ | ||
356 | |||
357 | gtk_widget_style_get (GTK_WIDGET (menu), | ||
358 | "vertical-padding", &vertical_padding, | ||
359 | + "horizontal-padding", &horizontal_padding, | ||
360 | NULL); | ||
361 | |||
362 | - attributes.x = border_width + widget->style->xthickness; | ||
363 | + attributes.x = border_width + widget->style->xthickness + horizontal_padding; | ||
364 | attributes.y = border_width + widget->style->ythickness + vertical_padding; | ||
365 | attributes.width = MAX (1, widget->allocation.width - attributes.x * 2); | ||
366 | attributes.height = MAX (1, widget->allocation.height - attributes.y * 2); | ||
367 | @@ -2040,11 +2195,14 @@ | ||
368 | if (menu->lower_arrow_visible) | ||
369 | attributes.height -= MENU_SCROLL_ARROW_HEIGHT; | ||
370 | |||
371 | + attributes.window_type = GDK_WINDOW_CHILD; | ||
372 | + | ||
373 | menu->view_window = gdk_window_new (widget->window, &attributes, attributes_mask); | ||
374 | gdk_window_set_user_data (menu->view_window, menu); | ||
375 | |||
376 | attributes.x = 0; | ||
377 | attributes.y = 0; | ||
378 | + attributes.width = MAX (1, widget->requisition.width - (border_width + widget->style->xthickness + horizontal_padding) * 2); | ||
379 | attributes.height = MAX (1, widget->requisition.height - (border_width + widget->style->ythickness + vertical_padding) * 2); | ||
380 | |||
381 | menu->bin_window = gdk_window_new (menu->view_window, &attributes, attributes_mask); | ||
382 | @@ -2164,6 +2322,10 @@ | ||
383 | guint vertical_padding; | ||
384 | GtkRequisition child_requisition; | ||
385 | GtkMenuPrivate *priv; | ||
386 | + guint horizontal_padding; | ||
387 | + GdkScreen *screen; | ||
388 | + GdkRectangle monitor; | ||
389 | + gint monitor_num; | ||
390 | |||
391 | g_return_if_fail (GTK_IS_MENU (widget)); | ||
392 | g_return_if_fail (requisition != NULL); | ||
393 | @@ -2182,6 +2344,16 @@ | ||
394 | priv->heights = g_new0 (guint, gtk_menu_get_n_rows (menu)); | ||
395 | priv->heights_length = gtk_menu_get_n_rows (menu); | ||
396 | |||
397 | +/* Hildon addition to find out the monitor width */ | ||
398 | + screen = gtk_widget_get_screen (widget); | ||
399 | + if (widget->window != NULL) | ||
400 | + monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window); | ||
401 | + else | ||
402 | + monitor_num = 0; | ||
403 | + if (monitor_num < 0) | ||
404 | + monitor_num = 0; | ||
405 | + gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); | ||
406 | + | ||
407 | children = menu_shell->children; | ||
408 | while (children) | ||
409 | { | ||
410 | @@ -2223,15 +2395,18 @@ | ||
411 | |||
412 | requisition->width += max_toggle_size + max_accel_width; | ||
413 | requisition->width *= gtk_menu_get_n_columns (menu); | ||
414 | - requisition->width += (GTK_CONTAINER (menu)->border_width + | ||
415 | - widget->style->xthickness) * 2; | ||
416 | |||
417 | gtk_widget_style_get (GTK_WIDGET (menu), | ||
418 | + "horizontal-padding", &horizontal_padding, | ||
419 | "vertical-padding", &vertical_padding, | ||
420 | NULL); | ||
421 | + requisition->width += (GTK_CONTAINER (menu)->border_width + horizontal_padding + | ||
422 | + widget->style->xthickness) * 2; | ||
423 | requisition->height += (GTK_CONTAINER (menu)->border_width + vertical_padding + | ||
424 | widget->style->ythickness) * 2; | ||
425 | |||
426 | +/* Hildon addition to not make the menu too wide for the screen. */ | ||
427 | + requisition->width = MIN (requisition->width, monitor.width); | ||
428 | menu->toggle_size = max_toggle_size; | ||
429 | |||
430 | /* Don't resize the tearoff if it is not active, because it won't redraw (it is only a background pixmap). | ||
431 | @@ -2253,6 +2428,7 @@ | ||
432 | GList *children; | ||
433 | gint x, y; | ||
434 | gint width, height; | ||
435 | + guint horizontal_padding; | ||
436 | guint vertical_padding; | ||
437 | |||
438 | g_return_if_fail (GTK_IS_MENU (widget)); | ||
439 | @@ -2266,10 +2442,11 @@ | ||
440 | gtk_widget_get_child_requisition (GTK_WIDGET (menu), &child_requisition); | ||
441 | |||
442 | gtk_widget_style_get (GTK_WIDGET (menu), | ||
443 | + "horizontal-padding", &horizontal_padding, | ||
444 | "vertical-padding", &vertical_padding, | ||
445 | NULL); | ||
446 | |||
447 | - x = GTK_CONTAINER (menu)->border_width + widget->style->xthickness; | ||
448 | + x = GTK_CONTAINER (menu)->border_width + widget->style->xthickness + horizontal_padding; | ||
449 | y = GTK_CONTAINER (menu)->border_width + widget->style->ythickness + vertical_padding; | ||
450 | |||
451 | width = MAX (1, allocation->width - x * 2); | ||
452 | @@ -2407,27 +2584,32 @@ | ||
453 | GdkEventExpose *event) | ||
454 | { | ||
455 | GtkMenu *menu; | ||
456 | - gint width, height; | ||
457 | - gint border_x, border_y; | ||
458 | - guint vertical_padding; | ||
459 | |||
460 | g_return_if_fail (GTK_IS_MENU (widget)); | ||
461 | |||
462 | menu = GTK_MENU (widget); | ||
463 | |||
464 | - gtk_widget_style_get (GTK_WIDGET (menu), | ||
465 | - "vertical-padding", &vertical_padding, | ||
466 | - NULL); | ||
467 | - | ||
468 | - border_x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness; | ||
469 | - border_y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness + vertical_padding; | ||
470 | - gdk_drawable_get_size (widget->window, &width, &height); | ||
471 | - | ||
472 | if (event->window == widget->window) | ||
473 | { | ||
474 | + gint width, height; | ||
475 | + gint border_x, border_y; | ||
476 | + guint vertical_padding; | ||
477 | + guint horizontal_padding; | ||
478 | + GtkMenuPrivate *priv; | ||
479 | gint arrow_space = MENU_SCROLL_ARROW_HEIGHT - 2 * widget->style->ythickness; | ||
480 | gint arrow_size = 0.7 * arrow_space; | ||
481 | |||
482 | + priv = gtk_menu_get_private (menu); | ||
483 | + | ||
484 | + gtk_widget_style_get (GTK_WIDGET (menu), | ||
485 | + "vertical-padding", &vertical_padding, | ||
486 | + "horizontal-padding", &horizontal_padding, | ||
487 | + NULL); | ||
488 | + | ||
489 | + border_x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness + horizontal_padding; | ||
490 | + border_y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness + vertical_padding; | ||
491 | + gdk_drawable_get_size (widget->window, &width, &height); | ||
492 | + | ||
493 | gtk_paint_box (widget->style, | ||
494 | widget->window, | ||
495 | GTK_STATE_NORMAL, | ||
496 | @@ -2436,21 +2618,9 @@ | ||
497 | 0, 0, -1, -1); | ||
498 | if (menu->upper_arrow_visible && !menu->tearoff_active) | ||
499 | { | ||
500 | - gtk_paint_box (widget->style, | ||
501 | - widget->window, | ||
502 | - menu->upper_arrow_prelight ? | ||
503 | - GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, | ||
504 | - GTK_SHADOW_OUT, | ||
505 | - NULL, widget, "menu", | ||
506 | - border_x, | ||
507 | - border_y, | ||
508 | - width - 2 * border_x, | ||
509 | - MENU_SCROLL_ARROW_HEIGHT); | ||
510 | - | ||
511 | gtk_paint_arrow (widget->style, | ||
512 | widget->window, | ||
513 | - menu->upper_arrow_prelight ? | ||
514 | - GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, | ||
515 | + priv->upper_arrow_state, | ||
516 | GTK_SHADOW_OUT, | ||
517 | NULL, widget, "menu_scroll_arrow_up", | ||
518 | GTK_ARROW_UP, | ||
519 | @@ -2462,21 +2632,9 @@ | ||
520 | |||
521 | if (menu->lower_arrow_visible && !menu->tearoff_active) | ||
522 | { | ||
523 | - gtk_paint_box (widget->style, | ||
524 | - widget->window, | ||
525 | - menu->lower_arrow_prelight ? | ||
526 | - GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, | ||
527 | - GTK_SHADOW_OUT, | ||
528 | - NULL, widget, "menu", | ||
529 | - border_x, | ||
530 | - height - border_y - MENU_SCROLL_ARROW_HEIGHT, | ||
531 | - width - 2*border_x, | ||
532 | - MENU_SCROLL_ARROW_HEIGHT); | ||
533 | - | ||
534 | gtk_paint_arrow (widget->style, | ||
535 | widget->window, | ||
536 | - menu->lower_arrow_prelight ? | ||
537 | - GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, | ||
538 | + priv->lower_arrow_state, | ||
539 | GTK_SHADOW_OUT, | ||
540 | NULL, widget, "menu_scroll_arrow_down", | ||
541 | GTK_ARROW_DOWN, | ||
542 | @@ -2516,18 +2674,82 @@ | ||
543 | GTK_WIDGET_CLASS (parent_class)->show (widget); | ||
544 | } | ||
545 | |||
546 | +static GtkWidget * | ||
547 | +find_active_menu_item (GdkEventButton *event) | ||
548 | +{ | ||
549 | + GtkWidget *menu_item; | ||
550 | + | ||
551 | + menu_item = gtk_get_event_widget ((GdkEvent*) event); | ||
552 | + while (menu_item && !GTK_IS_MENU_ITEM (menu_item)) | ||
553 | + menu_item = menu_item->parent; | ||
554 | + | ||
555 | + return menu_item; | ||
556 | +} | ||
557 | + | ||
558 | +static gboolean | ||
559 | +pointer_in_menu_tree (GtkWidget *widget) | ||
560 | +{ | ||
561 | + GtkMenuShell *mshell; | ||
562 | + int width, height, x, y; | ||
563 | + | ||
564 | + mshell = GTK_MENU_SHELL (widget); | ||
565 | + | ||
566 | + gdk_window_get_pointer (widget->window, &x, &y, NULL); | ||
567 | + gdk_drawable_get_size (widget->window, &width, &height); | ||
568 | + | ||
569 | + if ((x <= width) && (x >= 0) && (y <= height) && (y >= 0)) | ||
570 | + return TRUE; | ||
571 | + | ||
572 | + if ((mshell->parent_menu_shell != NULL) && | ||
573 | + GTK_IS_MENU (mshell->parent_menu_shell)) | ||
574 | + return pointer_in_menu_tree (mshell->parent_menu_shell); | ||
575 | + | ||
576 | + return FALSE; | ||
577 | +} | ||
578 | + | ||
579 | +static int | ||
580 | +distance_traveled (GtkWidget *widget) | ||
581 | +{ | ||
582 | + GtkMenuPrivate *priv; | ||
583 | + GdkScreen *screen; | ||
584 | + GdkDisplay *display; | ||
585 | + int x, y, dx, dy; | ||
586 | + | ||
587 | + priv = gtk_menu_get_private (GTK_MENU (widget)); | ||
588 | + | ||
589 | + screen = gtk_widget_get_screen (widget); | ||
590 | + display = gdk_screen_get_display (screen); | ||
591 | + | ||
592 | + gdk_display_get_pointer (display, NULL, &x, &y, NULL); | ||
593 | + | ||
594 | + dx = (priv->popup_pointer_x - x); | ||
595 | + dy = (priv->popup_pointer_y - y); | ||
596 | + | ||
597 | + return abs ((int) sqrt ((double) (dx * dx + dy * dy))); | ||
598 | +} | ||
599 | + | ||
600 | static gboolean | ||
601 | gtk_menu_button_press (GtkWidget *widget, | ||
602 | - GdkEventButton *event) | ||
603 | + GdkEventButton *event) | ||
604 | { | ||
605 | - /* Don't pop down the menu for releases over scroll arrows | ||
606 | - */ | ||
607 | - if (GTK_IS_MENU (widget)) | ||
608 | + GtkWidget *menu_item; | ||
609 | + | ||
610 | + menu_item = find_active_menu_item (event); | ||
611 | + if (menu_item == NULL) | ||
612 | { | ||
613 | GtkMenu *menu = GTK_MENU (widget); | ||
614 | |||
615 | - if (menu->upper_arrow_prelight || menu->lower_arrow_prelight) | ||
616 | - return TRUE; | ||
617 | + if (menu->upper_arrow_prelight || menu->lower_arrow_prelight) | ||
618 | + { | ||
619 | + gtk_menu_handle_scrolling (GTK_MENU (widget), event->x_root, event->y_root, TRUE, FALSE); | ||
620 | + | ||
621 | + return TRUE; | ||
622 | + } | ||
623 | + | ||
624 | + /* Don't pass down to menu shell if a non-menuitem part | ||
625 | + * of the menu was clicked. */ | ||
626 | + if (pointer_in_menu_tree (widget)) | ||
627 | + return TRUE; | ||
628 | } | ||
629 | |||
630 | return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, event); | ||
631 | @@ -2537,14 +2759,44 @@ | ||
632 | gtk_menu_button_release (GtkWidget *widget, | ||
633 | GdkEventButton *event) | ||
634 | { | ||
635 | - /* Don't pop down the menu for releases over scroll arrows | ||
636 | - */ | ||
637 | - if (GTK_IS_MENU (widget)) | ||
638 | + GtkMenuPrivate *priv; | ||
639 | + GtkWidget *menu_item; | ||
640 | + | ||
641 | + priv = gtk_menu_get_private (GTK_MENU (widget)); | ||
642 | + | ||
643 | + menu_item = find_active_menu_item (event); | ||
644 | + if (menu_item == NULL) | ||
645 | { | ||
646 | GtkMenu *menu = GTK_MENU (widget); | ||
647 | |||
648 | - if (menu->upper_arrow_prelight || menu->lower_arrow_prelight) | ||
649 | - return TRUE; | ||
650 | + if (menu->upper_arrow_prelight || menu->lower_arrow_prelight) | ||
651 | + { | ||
652 | + gtk_menu_handle_scrolling (GTK_MENU (widget), event->x_root, event->y_root, FALSE, FALSE); | ||
653 | + | ||
654 | + return TRUE; | ||
655 | + } | ||
656 | + | ||
657 | + if (priv->context_menu && | ||
658 | + (priv->popup_pointer_x >= 0) && | ||
659 | + (priv->popup_pointer_y >= 0)) | ||
660 | + { | ||
661 | + int distance; | ||
662 | + | ||
663 | + distance = distance_traveled (widget); | ||
664 | + | ||
665 | + priv->popup_pointer_x = -1; | ||
666 | + priv->popup_pointer_y = -1; | ||
667 | + | ||
668 | + /* Don't popdown if we traveled less than 20px since popup point, | ||
669 | + * as per the specs. */ | ||
670 | + if (distance < 20) | ||
671 | + return TRUE; | ||
672 | + } | ||
673 | + | ||
674 | + /* Don't pass down to menu shell if a non-menuitem part | ||
675 | + * of the menu was clicked. */ | ||
676 | + if (pointer_in_menu_tree (widget)) | ||
677 | + return TRUE; | ||
678 | } | ||
679 | |||
680 | return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event); | ||
681 | @@ -2765,7 +3017,7 @@ | ||
682 | gboolean need_enter; | ||
683 | |||
684 | if (GTK_IS_MENU (widget)) | ||
685 | - gtk_menu_handle_scrolling (GTK_MENU (widget), event->x_root, event->y_root, TRUE); | ||
686 | + gtk_menu_handle_scrolling (GTK_MENU (widget), event->x_root, event->y_root, TRUE, TRUE); | ||
687 | |||
688 | /* We received the event for one of two reasons: | ||
689 | * | ||
690 | @@ -2779,7 +3031,27 @@ | ||
691 | menu_item = gtk_get_event_widget ((GdkEvent*) event); | ||
692 | if (!menu_item || !GTK_IS_MENU_ITEM (menu_item) || | ||
693 | !GTK_IS_MENU (menu_item->parent)) | ||
694 | - return FALSE; | ||
695 | + { | ||
696 | + GtkMenuPrivate *priv; | ||
697 | + | ||
698 | + priv = gtk_menu_get_private (GTK_MENU (widget)); | ||
699 | + | ||
700 | + if (priv->context_menu) | ||
701 | + { | ||
702 | + /* Context menu mode. If we dragged out of the menu, | ||
703 | + * close the menu, as by the specs. */ | ||
704 | + if (!pointer_in_menu_tree (widget) && | ||
705 | + (distance_traveled (widget) >= 20) && | ||
706 | + (event->state & GDK_BUTTON1_MASK)) | ||
707 | + { | ||
708 | + gtk_menu_deactivate (GTK_MENU_SHELL (widget)); | ||
709 | + | ||
710 | + return TRUE; | ||
711 | + } | ||
712 | + } | ||
713 | + | ||
714 | + return FALSE; | ||
715 | + } | ||
716 | |||
717 | menu_shell = GTK_MENU_SHELL (menu_item->parent); | ||
718 | menu = GTK_MENU (menu_shell); | ||
719 | @@ -2795,6 +3067,11 @@ | ||
720 | */ | ||
721 | if (gtk_menu_navigating_submenu (menu, event->x_root, event->y_root)) | ||
722 | return TRUE; | ||
723 | +/* HILDON MOD. | ||
724 | + * Close the submenus that are two levels down from the currently selected. | ||
725 | + * This ensures that the focus is correct all the time.*/ | ||
726 | + if (GTK_MENU_ITEM(menu_item)->submenu != NULL) | ||
727 | + gtk_menu_shell_deselect (GTK_MENU_SHELL(&(GTK_MENU(GTK_MENU_ITEM(menu_item)->submenu)->menu_shell))); | ||
728 | |||
729 | /* Make sure we pop down if we enter a non-selectable menu item, so we | ||
730 | * don't show a submenu when the cursor is outside the stay-up triangle. | ||
731 | @@ -2828,6 +3105,7 @@ | ||
732 | send_event->crossing.y_root = event->y_root; | ||
733 | send_event->crossing.x = event->x; | ||
734 | send_event->crossing.y = event->y; | ||
735 | + send_event->crossing.state = event->state; | ||
736 | |||
737 | /* We send the event to 'widget', the currently active menu, | ||
738 | * instead of 'menu', the menu that the pointer is in. This | ||
739 | @@ -2852,17 +3130,24 @@ | ||
740 | GtkWidget *widget; | ||
741 | gint offset; | ||
742 | gint view_width, view_height; | ||
743 | + gboolean double_arrows; | ||
744 | |||
745 | widget = GTK_WIDGET (menu); | ||
746 | offset = menu->scroll_offset + step; | ||
747 | |||
748 | + /* get double_arrows style property */ | ||
749 | + gtk_widget_style_get (widget, | ||
750 | + "double_arrows", &double_arrows, | ||
751 | + NULL); | ||
752 | + | ||
753 | /* If we scroll upward and the non-visible top part | ||
754 | * is smaller than the scroll arrow it would be | ||
755 | * pretty stupid to show the arrow and taking more | ||
756 | * screen space than just scrolling to the top. | ||
757 | */ | ||
758 | - if ((step < 0) && (offset < MENU_SCROLL_ARROW_HEIGHT)) | ||
759 | - offset = 0; | ||
760 | + if (!double_arrows) | ||
761 | + if ((step < 0) && (offset < MENU_SCROLL_ARROW_HEIGHT)) | ||
762 | + offset = 0; | ||
763 | |||
764 | /* Don't scroll over the top if we weren't before: */ | ||
765 | if ((menu->scroll_offset >= 0) && (offset < 0)) | ||
766 | @@ -2874,6 +3159,12 @@ | ||
767 | if (menu->scroll_offset > 0) | ||
768 | view_height -= MENU_SCROLL_ARROW_HEIGHT; | ||
769 | |||
770 | + /* When both arrows are always shown, reduce | ||
771 | + * view height even more. | ||
772 | + */ | ||
773 | + if (double_arrows) | ||
774 | + view_height -= MENU_SCROLL_ARROW_HEIGHT; | ||
775 | + | ||
776 | if ((menu->scroll_offset + view_height <= widget->requisition.height) && | ||
777 | (offset + view_height > widget->requisition.height)) | ||
778 | offset = widget->requisition.height - view_height; | ||
779 | @@ -2922,18 +3213,21 @@ | ||
780 | gtk_menu_handle_scrolling (GtkMenu *menu, | ||
781 | gint x, | ||
782 | gint y, | ||
783 | - gboolean enter) | ||
784 | + gboolean enter, | ||
785 | + gboolean motion) | ||
786 | { | ||
787 | GtkMenuShell *menu_shell; | ||
788 | + GtkMenuPrivate *priv; | ||
789 | gint width, height; | ||
790 | gint border; | ||
791 | GdkRectangle rect; | ||
792 | - gboolean in_arrow; | ||
793 | gboolean scroll_fast = FALSE; | ||
794 | guint vertical_padding; | ||
795 | gint top_x, top_y; | ||
796 | gint win_x, win_y; | ||
797 | |||
798 | + priv = gtk_menu_get_private (menu); | ||
799 | + | ||
800 | menu_shell = GTK_MENU_SHELL (menu); | ||
801 | |||
802 | gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, &height); | ||
803 | @@ -2946,10 +3240,11 @@ | ||
804 | GTK_WIDGET (menu)->style->ythickness + vertical_padding; | ||
805 | |||
806 | gdk_window_get_position (menu->toplevel->window, &top_x, &top_y); | ||
807 | + x -= top_x; | ||
808 | + y -= top_y; | ||
809 | + | ||
810 | gdk_window_get_position (GTK_WIDGET (menu)->window, &win_x, &win_y); | ||
811 | - win_x += top_x; | ||
812 | - win_y += top_y; | ||
813 | - | ||
814 | + | ||
815 | if (menu->upper_arrow_visible && !menu->tearoff_active) | ||
816 | { | ||
817 | rect.x = win_x; | ||
818 | @@ -2957,35 +3252,49 @@ | ||
819 | rect.width = width; | ||
820 | rect.height = MENU_SCROLL_ARROW_HEIGHT + border; | ||
821 | |||
822 | - in_arrow = FALSE; | ||
823 | + menu->upper_arrow_prelight = FALSE; | ||
824 | if ((x >= rect.x) && (x < rect.x + rect.width) && | ||
825 | (y >= rect.y) && (y < rect.y + rect.height)) | ||
826 | - { | ||
827 | - in_arrow = TRUE; | ||
828 | - scroll_fast = (y < rect.y + MENU_SCROLL_FAST_ZONE); | ||
829 | - } | ||
830 | - | ||
831 | - if (enter && in_arrow && | ||
832 | - (!menu->upper_arrow_prelight || menu->scroll_fast != scroll_fast)) | ||
833 | - { | ||
834 | - menu->upper_arrow_prelight = TRUE; | ||
835 | - menu->scroll_fast = scroll_fast; | ||
836 | - gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, &rect, FALSE); | ||
837 | - | ||
838 | - /* Deselect the active item so that any submenus are poped down */ | ||
839 | - gtk_menu_shell_deselect (menu_shell); | ||
840 | + menu->upper_arrow_prelight = TRUE; | ||
841 | |||
842 | - gtk_menu_remove_scroll_timeout (menu); | ||
843 | - menu->scroll_step = (scroll_fast) ? -MENU_SCROLL_STEP2 : -MENU_SCROLL_STEP1; | ||
844 | - menu->timeout_id = g_timeout_add ((scroll_fast) ? MENU_SCROLL_TIMEOUT2 : MENU_SCROLL_TIMEOUT1, | ||
845 | - gtk_menu_scroll_timeout, | ||
846 | - menu); | ||
847 | - } | ||
848 | - else if (!enter && !in_arrow && menu->upper_arrow_prelight) | ||
849 | + if (priv->upper_arrow_state != GTK_STATE_INSENSITIVE) | ||
850 | { | ||
851 | - gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, &rect, FALSE); | ||
852 | - | ||
853 | - gtk_menu_stop_scrolling (menu); | ||
854 | + if (enter && menu->upper_arrow_prelight && | ||
855 | + (menu->timeout_id == 0 || menu->scroll_fast != scroll_fast)) | ||
856 | + { | ||
857 | + menu->scroll_fast = scroll_fast; | ||
858 | + | ||
859 | + /* Deselect the active item so that any submenus are poped down */ | ||
860 | + gtk_menu_shell_deselect (menu_shell); | ||
861 | + | ||
862 | + gtk_menu_remove_scroll_timeout (menu); | ||
863 | + menu->scroll_step = (scroll_fast) ? -MENU_SCROLL_STEP2 : -MENU_SCROLL_STEP1; | ||
864 | + | ||
865 | + if (!motion) | ||
866 | + { | ||
867 | + /* Only do stuff on click. */ | ||
868 | + GtkSettings *settings; | ||
869 | + guint timeout; | ||
870 | + | ||
871 | + settings = gtk_settings_get_default (); | ||
872 | + g_object_get (settings, "gtk-update-timeout", &timeout, NULL); | ||
873 | + | ||
874 | + menu->timeout_id = g_timeout_add (timeout / 2, gtk_menu_scroll_timeout, menu); | ||
875 | + | ||
876 | + priv->upper_arrow_state = GTK_STATE_ACTIVE; | ||
877 | + } | ||
878 | + | ||
879 | + gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, &rect, FALSE); | ||
880 | + } | ||
881 | + else if (!enter) | ||
882 | + { | ||
883 | + gtk_menu_stop_scrolling (menu); | ||
884 | + | ||
885 | + priv->upper_arrow_state = menu->upper_arrow_prelight ? | ||
886 | + GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | ||
887 | + | ||
888 | + gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, &rect, FALSE); | ||
889 | + } | ||
890 | } | ||
891 | } | ||
892 | |||
893 | @@ -2996,36 +3305,50 @@ | ||
894 | rect.width = width; | ||
895 | rect.height = MENU_SCROLL_ARROW_HEIGHT + border; | ||
896 | |||
897 | - in_arrow = FALSE; | ||
898 | + menu->lower_arrow_prelight = FALSE; | ||
899 | if ((x >= rect.x) && (x < rect.x + rect.width) && | ||
900 | (y >= rect.y) && (y < rect.y + rect.height)) | ||
901 | - { | ||
902 | - in_arrow = TRUE; | ||
903 | - scroll_fast = (y > rect.y + rect.height - MENU_SCROLL_FAST_ZONE); | ||
904 | - } | ||
905 | + menu->lower_arrow_prelight = TRUE; | ||
906 | |||
907 | - if (enter && in_arrow && | ||
908 | - (!menu->lower_arrow_prelight || menu->scroll_fast != scroll_fast)) | ||
909 | + if (priv->lower_arrow_state != GTK_STATE_INSENSITIVE) | ||
910 | { | ||
911 | - menu->lower_arrow_prelight = TRUE; | ||
912 | - menu->scroll_fast = scroll_fast; | ||
913 | - gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, &rect, FALSE); | ||
914 | + if (enter && menu->lower_arrow_prelight && | ||
915 | + (menu->timeout_id == 0 || menu->scroll_fast != scroll_fast)) | ||
916 | + { | ||
917 | + menu->scroll_fast = scroll_fast; | ||
918 | |||
919 | - /* Deselect the active item so that any submenus are poped down */ | ||
920 | - gtk_menu_shell_deselect (menu_shell); | ||
921 | + /* Deselect the active item so that any submenus are poped down */ | ||
922 | + gtk_menu_shell_deselect (menu_shell); | ||
923 | |||
924 | - gtk_menu_remove_scroll_timeout (menu); | ||
925 | - menu->scroll_step = (scroll_fast) ? MENU_SCROLL_STEP2 : MENU_SCROLL_STEP1; | ||
926 | - menu->timeout_id = g_timeout_add ((scroll_fast) ? MENU_SCROLL_TIMEOUT2 : MENU_SCROLL_TIMEOUT1, | ||
927 | - gtk_menu_scroll_timeout, | ||
928 | - menu); | ||
929 | - } | ||
930 | - else if (!enter && !in_arrow && menu->lower_arrow_prelight) | ||
931 | - { | ||
932 | - gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, &rect, FALSE); | ||
933 | - | ||
934 | - gtk_menu_stop_scrolling (menu); | ||
935 | - } | ||
936 | + gtk_menu_remove_scroll_timeout (menu); | ||
937 | + menu->scroll_step = (scroll_fast) ? MENU_SCROLL_STEP2 : MENU_SCROLL_STEP1; | ||
938 | + | ||
939 | + if (!motion) | ||
940 | + { | ||
941 | + /* Only do stuff on click. */ | ||
942 | + GtkSettings *settings; | ||
943 | + guint timeout; | ||
944 | + | ||
945 | + settings = gtk_settings_get_default (); | ||
946 | + g_object_get (settings, "gtk-update-timeout", &timeout, NULL); | ||
947 | + | ||
948 | + menu->timeout_id = g_timeout_add (timeout / 2, gtk_menu_scroll_timeout, menu); | ||
949 | + | ||
950 | + priv->lower_arrow_state = GTK_STATE_ACTIVE; | ||
951 | + } | ||
952 | + | ||
953 | + gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, &rect, FALSE); | ||
954 | + } | ||
955 | + else if (!enter) | ||
956 | + { | ||
957 | + gtk_menu_stop_scrolling (menu); | ||
958 | + | ||
959 | + priv->lower_arrow_state = menu->lower_arrow_prelight ? | ||
960 | + GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | ||
961 | + | ||
962 | + gdk_window_invalidate_rect (GTK_WIDGET (menu)->window, &rect, FALSE); | ||
963 | + } | ||
964 | + } | ||
965 | } | ||
966 | } | ||
967 | |||
968 | @@ -3041,7 +3364,7 @@ | ||
969 | GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget); | ||
970 | |||
971 | if (!menu_shell->ignore_enter) | ||
972 | - gtk_menu_handle_scrolling (GTK_MENU (widget), event->x_root, event->y_root, TRUE); | ||
973 | + gtk_menu_handle_scrolling (GTK_MENU (widget), event->x_root, event->y_root, TRUE, TRUE); | ||
974 | } | ||
975 | |||
976 | if (menu_item && GTK_IS_MENU_ITEM (menu_item)) | ||
977 | @@ -3106,7 +3429,7 @@ | ||
978 | if (gtk_menu_navigating_submenu (menu, event->x_root, event->y_root)) | ||
979 | return TRUE; | ||
980 | |||
981 | - gtk_menu_handle_scrolling (menu, event->x_root, event->y_root, FALSE); | ||
982 | + gtk_menu_handle_scrolling (menu, event->x_root, event->y_root, FALSE, TRUE); | ||
983 | |||
984 | event_widget = gtk_get_event_widget ((GdkEvent*) event); | ||
985 | |||
986 | @@ -3611,7 +3934,13 @@ | ||
987 | requisition.width, requisition.height); | ||
988 | } | ||
989 | |||
990 | - menu->scroll_offset = scroll_offset; | ||
991 | + /* Hildon hack for menu in comboboxes: | ||
992 | + * in case the menu in attached to a ComboBox, the scroll_offset is | ||
993 | + * calculated in the positioning function so we dont't overwrite it | ||
994 | + * with the value calculated above (in this function) */ | ||
995 | + if ( !GTK_IS_COMBO_BOX(gtk_menu_get_attach_widget(menu)) ) | ||
996 | + menu->scroll_offset = scroll_offset; | ||
997 | + | ||
998 | } | ||
999 | |||
1000 | static void | ||
1001 | @@ -3628,9 +3957,6 @@ | ||
1002 | gtk_menu_stop_scrolling (GtkMenu *menu) | ||
1003 | { | ||
1004 | gtk_menu_remove_scroll_timeout (menu); | ||
1005 | - | ||
1006 | - menu->upper_arrow_prelight = FALSE; | ||
1007 | - menu->lower_arrow_prelight = FALSE; | ||
1008 | } | ||
1009 | |||
1010 | static void | ||
1011 | @@ -3644,6 +3970,8 @@ | ||
1012 | gboolean last_visible; | ||
1013 | gint menu_height; | ||
1014 | guint vertical_padding; | ||
1015 | + guint horizontal_padding; | ||
1016 | + gboolean double_arrows; | ||
1017 | |||
1018 | widget = GTK_WIDGET (menu); | ||
1019 | |||
1020 | @@ -3663,19 +3991,93 @@ | ||
1021 | |||
1022 | gtk_widget_style_get (GTK_WIDGET (menu), | ||
1023 | "vertical-padding", &vertical_padding, | ||
1024 | + "horizontal-padding", &horizontal_padding, | ||
1025 | + "double_arrows", &double_arrows, | ||
1026 | NULL); | ||
1027 | |||
1028 | border_width = GTK_CONTAINER (menu)->border_width; | ||
1029 | - view_width -= (border_width + widget->style->xthickness) * 2; | ||
1030 | + view_width -= (border_width + widget->style->xthickness + horizontal_padding) * 2; | ||
1031 | view_height -= (border_width + widget->style->ythickness + vertical_padding) * 2; | ||
1032 | menu_height = widget->requisition.height - | ||
1033 | (border_width + widget->style->ythickness + vertical_padding) * 2; | ||
1034 | |||
1035 | - x = border_width + widget->style->xthickness; | ||
1036 | + x = border_width + widget->style->xthickness + horizontal_padding; | ||
1037 | y = border_width + widget->style->ythickness + vertical_padding; | ||
1038 | |||
1039 | + if (double_arrows && !menu->tearoff_active && (view_height < menu_height)) | ||
1040 | + { | ||
1041 | + GtkMenuPrivate *priv; | ||
1042 | + GtkStateType upper_arrow_previous_state, lower_arrow_previous_state; | ||
1043 | + | ||
1044 | + priv = gtk_menu_get_private (menu); | ||
1045 | + | ||
1046 | + upper_arrow_previous_state = priv->upper_arrow_state; | ||
1047 | + lower_arrow_previous_state = priv->lower_arrow_state; | ||
1048 | + | ||
1049 | + if (!menu->upper_arrow_visible || !menu->lower_arrow_visible) | ||
1050 | + gtk_widget_queue_draw (GTK_WIDGET (menu)); | ||
1051 | + | ||
1052 | + view_height -= 2*MENU_SCROLL_ARROW_HEIGHT; | ||
1053 | + y += MENU_SCROLL_ARROW_HEIGHT; | ||
1054 | + | ||
1055 | + menu->upper_arrow_visible = menu->lower_arrow_visible = TRUE; | ||
1056 | + if (priv->upper_arrow_state == GTK_STATE_INSENSITIVE) | ||
1057 | + { | ||
1058 | + priv->upper_arrow_state = menu->upper_arrow_prelight ? | ||
1059 | + GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | ||
1060 | + } | ||
1061 | + if (priv->lower_arrow_state == GTK_STATE_INSENSITIVE) | ||
1062 | + { | ||
1063 | + priv->lower_arrow_state = menu->lower_arrow_prelight ? | ||
1064 | + GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | ||
1065 | + } | ||
1066 | + | ||
1067 | + if (offset <= 0) | ||
1068 | + { | ||
1069 | + offset = 0; | ||
1070 | + priv->upper_arrow_state = GTK_STATE_INSENSITIVE; | ||
1071 | + } | ||
1072 | + if (offset >= menu_height - view_height) | ||
1073 | + { | ||
1074 | + offset = menu_height - view_height; | ||
1075 | + priv->lower_arrow_state = GTK_STATE_INSENSITIVE; | ||
1076 | + } | ||
1077 | + | ||
1078 | + if ((priv->upper_arrow_state != upper_arrow_previous_state) || | ||
1079 | + (priv->lower_arrow_state != lower_arrow_previous_state)) | ||
1080 | + gtk_widget_queue_draw (GTK_WIDGET (menu)); | ||
1081 | + | ||
1082 | + if (upper_arrow_previous_state != GTK_STATE_INSENSITIVE && | ||
1083 | + priv->upper_arrow_state == GTK_STATE_INSENSITIVE) | ||
1084 | + { | ||
1085 | + /* If we hid the upper arrow, possibly remove timeout */ | ||
1086 | + if (menu->scroll_step < 0) | ||
1087 | + { | ||
1088 | + gtk_menu_stop_scrolling (menu); | ||
1089 | + gtk_widget_queue_draw (GTK_WIDGET (menu)); | ||
1090 | + } | ||
1091 | + } | ||
1092 | + | ||
1093 | + if (lower_arrow_previous_state != GTK_STATE_INSENSITIVE && | ||
1094 | + priv->lower_arrow_state == GTK_STATE_INSENSITIVE) | ||
1095 | + { | ||
1096 | + /* If we hid the lower arrow, possibly remove timeout */ | ||
1097 | + if (menu->scroll_step > 0) | ||
1098 | + { | ||
1099 | + gtk_menu_stop_scrolling (menu); | ||
1100 | + gtk_widget_queue_draw (GTK_WIDGET (menu)); | ||
1101 | + } | ||
1102 | + } | ||
1103 | + } | ||
1104 | + else | ||
1105 | if (!menu->tearoff_active) | ||
1106 | { | ||
1107 | + if (offset <= 0) | ||
1108 | + offset = 0; | ||
1109 | + | ||
1110 | + if (offset >= menu_height - view_height) | ||
1111 | + offset = menu_height - view_height; | ||
1112 | + | ||
1113 | last_visible = menu->upper_arrow_visible; | ||
1114 | menu->upper_arrow_visible = offset > 0; | ||
1115 | |||
1116 | @@ -3685,8 +4087,6 @@ | ||
1117 | if ( (last_visible != menu->upper_arrow_visible) && | ||
1118 | !menu->upper_arrow_visible) | ||
1119 | { | ||
1120 | - menu->upper_arrow_prelight = FALSE; | ||
1121 | - | ||
1122 | /* If we hid the upper arrow, possibly remove timeout */ | ||
1123 | if (menu->scroll_step < 0) | ||
1124 | { | ||
1125 | @@ -3704,8 +4104,6 @@ | ||
1126 | if ( (last_visible != menu->lower_arrow_visible) && | ||
1127 | !menu->lower_arrow_visible) | ||
1128 | { | ||
1129 | - menu->lower_arrow_prelight = FALSE; | ||
1130 | - | ||
1131 | /* If we hid the lower arrow, possibly remove timeout */ | ||
1132 | if (menu->scroll_step > 0) | ||
1133 | { | ||
1134 | @@ -3792,12 +4190,14 @@ | ||
1135 | &child_offset, &child_height, &last_child)) | ||
1136 | { | ||
1137 | guint vertical_padding; | ||
1138 | + gboolean double_arrows; | ||
1139 | |||
1140 | y = menu->scroll_offset; | ||
1141 | gdk_drawable_get_size (GTK_WIDGET (menu)->window, &width, &height); | ||
1142 | |||
1143 | gtk_widget_style_get (GTK_WIDGET (menu), | ||
1144 | "vertical-padding", &vertical_padding, | ||
1145 | + "double_arrows", &double_arrows, | ||
1146 | NULL); | ||
1147 | |||
1148 | height -= 2*GTK_CONTAINER (menu)->border_width + 2*GTK_WIDGET (menu)->style->ythickness + 2*vertical_padding; | ||
1149 | @@ -3820,11 +4220,11 @@ | ||
1150 | if (child_offset + child_height > y + height - arrow_height) | ||
1151 | { | ||
1152 | arrow_height = 0; | ||
1153 | - if (!last_child && !menu->tearoff_active) | ||
1154 | + if ((!last_child && !menu->tearoff_active) || (double_arrows)) | ||
1155 | arrow_height += MENU_SCROLL_ARROW_HEIGHT; | ||
1156 | |||
1157 | y = child_offset + child_height - height + arrow_height; | ||
1158 | - if ((y > 0) && !menu->tearoff_active) | ||
1159 | + if (((y > 0) && !menu->tearoff_active) || (double_arrows)) | ||
1160 | { | ||
1161 | /* Need upper arrow */ | ||
1162 | arrow_height += MENU_SCROLL_ARROW_HEIGHT; | ||
1163 | @@ -4374,3 +4774,60 @@ | ||
1164 | return list; | ||
1165 | } | ||
1166 | |||
1167 | +/* Little help function for making some sanity tests on this menu. | ||
1168 | + * Checks that given widget really is a menu and that it has no name | ||
1169 | + * assigned to it yet. | ||
1170 | + * Names used to do hildon theming: | ||
1171 | + * HILDON_MENU_NAME_SHARP for menu with sharp upper corners | ||
1172 | + * HILDON_MENU_NAME_ROUND for menu with round corners | ||
1173 | + */ | ||
1174 | +static gboolean | ||
1175 | +gtk_menu_check_name (GtkWidget *widget) | ||
1176 | +{ | ||
1177 | + gboolean legal_name = FALSE; | ||
1178 | + gchar **tmp = NULL; | ||
1179 | + const gchar *name = NULL; | ||
1180 | + static gchar *menu_names[] = { "GtkMenu", | ||
1181 | + HILDON_MENU_NAME_SHARP, | ||
1182 | + HILDON_MENU_NAME_ROUND, | ||
1183 | + HILDON_MENU_NAME_ROUND_FIRST_LEVEL, | ||
1184 | + NULL }; | ||
1185 | + if (GTK_IS_MENU (widget) && | ||
1186 | + (name = gtk_widget_get_name (widget))) | ||
1187 | + { | ||
1188 | + if (!g_ascii_strcasecmp (name, HILDON_MENU_NAME_FORCE_SHARP) || !g_ascii_strcasecmp (name, HILDON_MENU_NAME_FORCE_ROUND)) | ||
1189 | + return FALSE; | ||
1190 | + for (tmp = menu_names; *tmp; tmp++) | ||
1191 | + if (!g_ascii_strcasecmp (name, *tmp )) | ||
1192 | + { | ||
1193 | + legal_name = TRUE; | ||
1194 | + break; | ||
1195 | + } | ||
1196 | + } | ||
1197 | + | ||
1198 | + return legal_name; | ||
1199 | +} | ||
1200 | + | ||
1201 | +/* A function called when esc-key is pressed. */ | ||
1202 | +static void | ||
1203 | +_gtk_menu_close_current (GtkMenu * menu) | ||
1204 | +{ | ||
1205 | + GtkMenuShell * shell = GTK_MENU_SHELL (menu); | ||
1206 | + | ||
1207 | + /* Check is a submenu of current menu item is visible. | ||
1208 | + * If it is, close that first. */ | ||
1209 | + if (shell->active_menu_item && (GTK_MENU_ITEM (shell->active_menu_item)->submenu) && GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (shell->active_menu_item)->submenu)) | ||
1210 | + gtk_menu_popdown (GTK_MENU (GTK_MENU_ITEM (shell->active_menu_item)->submenu)); | ||
1211 | + else | ||
1212 | + gtk_menu_popdown (menu); | ||
1213 | + | ||
1214 | +} | ||
1215 | + | ||
1216 | +/* Hildon function to make context menus behave according to spec */ | ||
1217 | +void | ||
1218 | +_gtk_menu_enable_context_menu_behavior (GtkMenu *menu) | ||
1219 | +{ | ||
1220 | + GtkMenuPrivate *priv = gtk_menu_get_private (menu); | ||
1221 | + | ||
1222 | + priv->context_menu = TRUE; | ||
1223 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenu.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenu.h.diff deleted file mode 100644 index fc29e7965e..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenu.h.diff +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmenu.h 2004-05-06 10:35:26.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmenu.h 2005-04-06 16:19:36.943922032 +0300 | ||
3 | @@ -200,6 +200,9 @@ | ||
4 | gint monitor_num); | ||
5 | GList* gtk_menu_get_for_attach_widget (GtkWidget *widget); | ||
6 | |||
7 | +/* Private functions */ | ||
8 | +void _gtk_menu_enable_context_menu_behavior (GtkMenu *menu); | ||
9 | + | ||
10 | #ifndef GTK_DISABLE_DEPRECATED | ||
11 | #define gtk_menu_append(menu,child) gtk_menu_shell_append ((GtkMenuShell *)(menu),(child)) | ||
12 | #define gtk_menu_prepend(menu,child) gtk_menu_shell_prepend ((GtkMenuShell *)(menu),(child)) | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenuitem.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenuitem.c.diff deleted file mode 100644 index 7d8133e891..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenuitem.c.diff +++ /dev/null | |||
@@ -1,457 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmenuitem.c 2004-12-28 09:39:31.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmenuitem.c 2005-04-06 16:19:36.973917472 +0300 | ||
3 | @@ -24,6 +24,10 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2002-2003. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | #define GTK_MENU_INTERNALS | ||
12 | |||
13 | #include <config.h> | ||
14 | @@ -38,6 +42,9 @@ | ||
15 | #include "gtkmenuitem.h" | ||
16 | #include "gtkseparatormenuitem.h" | ||
17 | |||
18 | +#define HILDON_HEIGHT_INCREMENT 1 | ||
19 | +#define HILDON_ARROW_SPACE 6 | ||
20 | + | ||
21 | #define MENU_ITEM_CLASS(w) GTK_MENU_ITEM_CLASS (GTK_OBJECT (w)->klass) | ||
22 | |||
23 | enum { | ||
24 | @@ -95,6 +102,8 @@ | ||
25 | guint signal_id); | ||
26 | |||
27 | |||
28 | +static void _gtk_menu_item_activate_submenus (GtkMenuItem *item); | ||
29 | + | ||
30 | static GtkItemClass *parent_class; | ||
31 | static guint menu_item_signals[LAST_SIGNAL] = { 0 }; | ||
32 | |||
33 | @@ -158,7 +167,9 @@ | ||
34 | item_class->select = gtk_real_menu_item_select; | ||
35 | item_class->deselect = gtk_real_menu_item_deselect; | ||
36 | |||
37 | - klass->activate = NULL; | ||
38 | + /* Hildon addition : Added this to catch the | ||
39 | + * activation of meuuitems with submenus. */ | ||
40 | + klass->activate = _gtk_menu_item_activate_submenus; | ||
41 | klass->activate_item = gtk_real_menu_item_activate_item; | ||
42 | klass->toggle_size_request = gtk_real_menu_item_toggle_size_request; | ||
43 | klass->toggle_size_allocate = gtk_real_menu_item_toggle_size_allocate; | ||
44 | @@ -239,6 +250,16 @@ | ||
45 | G_MAXINT, | ||
46 | 10, | ||
47 | G_PARAM_READABLE)); | ||
48 | + | ||
49 | + /* Hildon modification - allow themeing of separator height */ | ||
50 | + gtk_widget_class_install_style_property (widget_class, | ||
51 | + g_param_spec_int ("separator_height", | ||
52 | + "Separator height", | ||
53 | + "Draw a separator graphics with height of x pixels.", | ||
54 | + 0, | ||
55 | + G_MAXINT, | ||
56 | + 5, | ||
57 | + G_PARAM_READABLE)); | ||
58 | } | ||
59 | |||
60 | static void | ||
61 | @@ -415,6 +436,13 @@ | ||
62 | g_return_if_fail (GTK_IS_MENU_ITEM (menu_item)); | ||
63 | |||
64 | gtk_item_select (GTK_ITEM (menu_item)); | ||
65 | + /* HILDON MOD. This is required as changed focus isn't drawn automatically | ||
66 | + * and drawing it must be requested. */ | ||
67 | + if ((GTK_WIDGET(menu_item)->parent) && GTK_IS_MENU (GTK_WIDGET(menu_item)->parent)) | ||
68 | + { | ||
69 | + GtkMenu *menu = GTK_MENU (GTK_WIDGET(menu_item)->parent); | ||
70 | + if (menu->parent_menu_item) gtk_widget_queue_draw(GTK_WIDGET(menu->parent_menu_item)); | ||
71 | + } | ||
72 | } | ||
73 | |||
74 | void | ||
75 | @@ -423,6 +451,13 @@ | ||
76 | g_return_if_fail (GTK_IS_MENU_ITEM (menu_item)); | ||
77 | |||
78 | gtk_item_deselect (GTK_ITEM (menu_item)); | ||
79 | + /* HILDON MOD. This is required as changed focus isn't drawn automatically | ||
80 | + * and drawing it must be requested. */ | ||
81 | + if ((GTK_WIDGET(menu_item)->parent) && GTK_IS_MENU (GTK_WIDGET(menu_item)->parent)) | ||
82 | + { | ||
83 | + GtkMenu *menu = GTK_MENU (GTK_WIDGET(menu_item)->parent); | ||
84 | + if (menu->parent_menu_item) gtk_widget_queue_draw(GTK_WIDGET(menu->parent_menu_item)); | ||
85 | + } | ||
86 | } | ||
87 | |||
88 | void | ||
89 | @@ -531,7 +566,7 @@ | ||
90 | "arrow_spacing", &arrow_spacing, | ||
91 | NULL); | ||
92 | |||
93 | - requisition->width += child_requisition.height; | ||
94 | + requisition->width += child_requisition.height + HILDON_ARROW_SPACE; | ||
95 | requisition->width += arrow_spacing; | ||
96 | |||
97 | requisition->width = MAX (requisition->width, get_minimum_width (widget)); | ||
98 | @@ -543,6 +578,12 @@ | ||
99 | requisition->height += 4; | ||
100 | } | ||
101 | |||
102 | + /* We get correct focus size if we make the widget a bit bigger. | ||
103 | + * (If the increment would be big, we should probably adjust the text | ||
104 | + * position aswell.) | ||
105 | + */ | ||
106 | + requisition->height += HILDON_HEIGHT_INCREMENT; | ||
107 | + | ||
108 | accel_width = 0; | ||
109 | gtk_container_foreach (GTK_CONTAINER (menu_item), | ||
110 | gtk_menu_item_accel_width_foreach, | ||
111 | @@ -596,7 +637,8 @@ | ||
112 | { | ||
113 | if (direction == GTK_TEXT_DIR_RTL) | ||
114 | child_allocation.x += child_requisition.height; | ||
115 | - child_allocation.width -= child_requisition.height; | ||
116 | + /* HILDON Modification. */ | ||
117 | + child_allocation.width -= child_requisition.height + HILDON_ARROW_SPACE; | ||
118 | } | ||
119 | |||
120 | if (child_allocation.width < 1) | ||
121 | @@ -688,6 +730,7 @@ | ||
122 | GtkShadowType shadow_type, selected_shadow_type; | ||
123 | gint width, height; | ||
124 | gint x, y; | ||
125 | + | ||
126 | gint border_width = GTK_CONTAINER (widget)->border_width; | ||
127 | |||
128 | if (GTK_WIDGET_DRAWABLE (widget)) | ||
129 | @@ -704,10 +747,56 @@ | ||
130 | if ((state_type == GTK_STATE_PRELIGHT) && | ||
131 | (GTK_BIN (menu_item)->child)) | ||
132 | { | ||
133 | + gint focus_x = x; | ||
134 | + gint focus_width = width; | ||
135 | gtk_widget_style_get (widget, | ||
136 | "selected_shadow_type", &selected_shadow_type, | ||
137 | NULL); | ||
138 | - gtk_paint_box (widget->style, | ||
139 | + | ||
140 | + if (menu_item->submenu && menu_item->show_submenu_indicator) | ||
141 | + { | ||
142 | + GtkRequisition child_requisition; | ||
143 | + gint arrow_size; | ||
144 | + /* gint arrow_extent; */ | ||
145 | + gtk_widget_get_child_requisition (GTK_BIN (menu_item)->child, | ||
146 | + &child_requisition); | ||
147 | + | ||
148 | + arrow_size = child_requisition.height - 2 * widget->style->ythickness; | ||
149 | + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) { | ||
150 | + focus_width = x + width - arrow_size - 2 - HILDON_ARROW_SPACE; | ||
151 | + } | ||
152 | + else { | ||
153 | + focus_x = x + arrow_size + 2 + HILDON_ARROW_SPACE; | ||
154 | + } | ||
155 | + } | ||
156 | + | ||
157 | + /* | ||
158 | + * Hildon modification: | ||
159 | + * This draws different focus depending on if it's the toplevel | ||
160 | + * focused menu item. All items that have submenus that in turn | ||
161 | + * have an item selected will be drawn with SELECTED - state focus. | ||
162 | + * If this isn't the case, PRELIGHT - state focus is used. */ | ||
163 | + if (menu_item->submenu) | ||
164 | + { | ||
165 | + GtkMenuItem *msi; | ||
166 | + msi = GTK_MENU_ITEM(GTK_MENU_SHELL(&((GTK_MENU(menu_item->submenu))->menu_shell))->active_menu_item); | ||
167 | + if ((msi == NULL) || (GTK_WIDGET (msi)->state == 0)) | ||
168 | + gtk_paint_box (widget->style, | ||
169 | + widget->window, | ||
170 | + GTK_STATE_PRELIGHT, | ||
171 | + selected_shadow_type, | ||
172 | + area, widget, "menuitem", | ||
173 | + focus_x, y, focus_width, height); | ||
174 | + else | ||
175 | + gtk_paint_box (widget->style, | ||
176 | + widget->window, | ||
177 | + GTK_STATE_SELECTED, | ||
178 | + selected_shadow_type, | ||
179 | + area, widget, "menuitem", | ||
180 | + focus_x, y, focus_width, height); | ||
181 | + } | ||
182 | + else | ||
183 | + gtk_paint_box (widget->style, | ||
184 | widget->window, | ||
185 | GTK_STATE_PRELIGHT, | ||
186 | selected_shadow_type, | ||
187 | @@ -747,8 +836,12 @@ | ||
188 | arrow_extent = arrow_size * 0.8; | ||
189 | |||
190 | shadow_type = GTK_SHADOW_OUT; | ||
191 | - if (state_type == GTK_STATE_PRELIGHT) | ||
192 | - shadow_type = GTK_SHADOW_IN; | ||
193 | + /*Hildon: only show the pressed arrow if the submenu is visible*/ | ||
194 | + if (state_type == GTK_STATE_PRELIGHT | ||
195 | + && GTK_WIDGET_VISIBLE( menu_item->submenu)) | ||
196 | + { | ||
197 | + shadow_type = GTK_SHADOW_IN; | ||
198 | + } | ||
199 | |||
200 | if (direction == GTK_TEXT_DIR_LTR) | ||
201 | { | ||
202 | @@ -763,6 +856,9 @@ | ||
203 | |||
204 | arrow_y = y + (height - arrow_extent) / 2; | ||
205 | |||
206 | +/* HILDON modification to correct focus drawing with submenu arrow */ | ||
207 | + arrow_x = arrow_x - 4; | ||
208 | + | ||
209 | gtk_paint_arrow (widget->style, widget->window, | ||
210 | state_type, shadow_type, | ||
211 | area, widget, "menuitem", | ||
212 | @@ -772,18 +868,20 @@ | ||
213 | } | ||
214 | else if (!GTK_BIN (menu_item)->child) | ||
215 | { | ||
216 | - guint horizontal_padding; | ||
217 | + guint horizontal_padding, separator_height; | ||
218 | |||
219 | gtk_widget_style_get (widget, | ||
220 | "horizontal_padding", &horizontal_padding, | ||
221 | + "separator_height", &separator_height, | ||
222 | NULL); | ||
223 | |||
224 | - gtk_paint_hline (widget->style, widget->window, GTK_STATE_NORMAL, | ||
225 | - area, widget, "menuitem", | ||
226 | - widget->allocation.x + horizontal_padding + widget->style->xthickness, | ||
227 | - widget->allocation.x + widget->allocation.width - horizontal_padding - widget->style->xthickness - 1, | ||
228 | - widget->allocation.y + (widget->allocation.height - | ||
229 | - widget->style->ythickness) / 2); | ||
230 | + /* themable menuitem for menu separators */ | ||
231 | + gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_NONE, | ||
232 | + area, widget, "separator", | ||
233 | + widget->allocation.x + horizontal_padding + widget->style->xthickness, | ||
234 | + widget->allocation.y + (widget->allocation.height - widget->style->ythickness) / 2, | ||
235 | + widget->allocation.x + widget->allocation.width - horizontal_padding - widget->style->xthickness - 1, | ||
236 | + separator_height); | ||
237 | } | ||
238 | } | ||
239 | } | ||
240 | @@ -839,6 +937,7 @@ | ||
241 | (!GTK_WIDGET_MAPPED (menu_item->submenu) || | ||
242 | GTK_MENU (menu_item->submenu)->tearoff_active)) | ||
243 | { | ||
244 | + GdkEvent *event = gtk_get_current_event (); | ||
245 | gint popup_delay; | ||
246 | |||
247 | if (menu_item->timer) | ||
248 | @@ -851,26 +950,40 @@ | ||
249 | popup_delay = get_popup_delay (menu_item); | ||
250 | |||
251 | if (popup_delay > 0) | ||
252 | - { | ||
253 | - GdkEvent *event = gtk_get_current_event (); | ||
254 | - | ||
255 | - menu_item->timer = g_timeout_add (popup_delay, | ||
256 | - gtk_menu_item_select_timeout, | ||
257 | - menu_item); | ||
258 | - if (event && | ||
259 | - event->type != GDK_BUTTON_PRESS && | ||
260 | - event->type != GDK_ENTER_NOTIFY) | ||
261 | - menu_item->timer_from_keypress = TRUE; | ||
262 | - else | ||
263 | - menu_item->timer_from_keypress = FALSE; | ||
264 | - | ||
265 | - if (event) | ||
266 | - gdk_event_free (event); | ||
267 | - } | ||
268 | + { | ||
269 | + /* OK, Here comes the contender for the 2003 Ugly Award | ||
270 | + * The popup delay is set small enough to be unnoticable, but high enough to not | ||
271 | + * notice the flickering which occurs when we close all the deepest menu's Gtk+ helpfully | ||
272 | + * expands but are not needed | ||
273 | + * This does not fix the mouse navigation yet (bug 18) but should take care of 442 | ||
274 | + * NOTE: test the delay factor on different CPU speeds | ||
275 | + */ | ||
276 | + popup_delay = 3; | ||
277 | + /* Hildon: Disabling the automatic opening of submenus. */ | ||
278 | + | ||
279 | + if (event && | ||
280 | + event->type != GDK_BUTTON_PRESS && | ||
281 | + event->type != GDK_ENTER_NOTIFY && | ||
282 | + event->type != GDK_MOTION_NOTIFY) /*hildon: for some reason, the event is sometimes this and not enter!*/ | ||
283 | + menu_item->timer_from_keypress = TRUE; | ||
284 | + else if (event) | ||
285 | + { | ||
286 | + /* mouse/pen events */ | ||
287 | + /* here is a problem -- when a menu item with sub menus gets a mouse event, | ||
288 | + another event is generated for the submenu (and further its submenu etc.) | ||
289 | + This leads to a behaviour which does not comply to the hildon spec. */ | ||
290 | + menu_item->timer_from_keypress = FALSE; | ||
291 | + } | ||
292 | + else /* does this really happen? */ | ||
293 | + menu_item->timer_from_keypress = FALSE; | ||
294 | + } | ||
295 | else | ||
296 | - _gtk_menu_item_popup_submenu (GTK_WIDGET (menu_item)); | ||
297 | + _gtk_menu_item_popup_submenu (menu_item); | ||
298 | + | ||
299 | + if (event) | ||
300 | + gdk_event_free (event); | ||
301 | } | ||
302 | - | ||
303 | + | ||
304 | gtk_widget_set_state (GTK_WIDGET (menu_item), GTK_STATE_PRELIGHT); | ||
305 | gtk_widget_queue_draw (GTK_WIDGET (menu_item)); | ||
306 | } | ||
307 | @@ -878,25 +991,16 @@ | ||
308 | static void | ||
309 | gtk_real_menu_item_deselect (GtkItem *item) | ||
310 | { | ||
311 | - GtkMenuItem *menu_item; | ||
312 | + GtkWidget *menu_item; | ||
313 | |||
314 | g_return_if_fail (GTK_IS_MENU_ITEM (item)); | ||
315 | |||
316 | - menu_item = GTK_MENU_ITEM (item); | ||
317 | + menu_item = GTK_WIDGET (item); | ||
318 | |||
319 | - if (menu_item->submenu) | ||
320 | - { | ||
321 | - if (menu_item->timer) | ||
322 | - { | ||
323 | - g_source_remove (menu_item->timer); | ||
324 | - menu_item->timer = 0; | ||
325 | - } | ||
326 | - else | ||
327 | - gtk_menu_popdown (GTK_MENU (menu_item->submenu)); | ||
328 | - } | ||
329 | + _gtk_menu_item_popdown_submenu (menu_item); | ||
330 | |||
331 | - gtk_widget_set_state (GTK_WIDGET (menu_item), GTK_STATE_NORMAL); | ||
332 | - gtk_widget_queue_draw (GTK_WIDGET (menu_item)); | ||
333 | + gtk_widget_set_state (menu_item, GTK_STATE_NORMAL); | ||
334 | + gtk_widget_queue_draw (menu_item); | ||
335 | } | ||
336 | |||
337 | static gboolean | ||
338 | @@ -941,10 +1045,7 @@ | ||
339 | _gtk_menu_shell_activate (menu_shell); | ||
340 | |||
341 | gtk_menu_shell_select_item (GTK_MENU_SHELL (widget->parent), widget); | ||
342 | - _gtk_menu_item_popup_submenu (widget); | ||
343 | - | ||
344 | - gtk_menu_shell_select_first (GTK_MENU_SHELL (menu_item->submenu), TRUE); | ||
345 | - submenu = GTK_MENU_SHELL (menu_item->submenu); | ||
346 | + /* Hildon mod: automatic submenu opening has been removed */ | ||
347 | } | ||
348 | } | ||
349 | } | ||
350 | @@ -983,7 +1084,7 @@ | ||
351 | { | ||
352 | _gtk_menu_item_popup_submenu (GTK_WIDGET (menu_item)); | ||
353 | if (menu_item->timer_from_keypress && menu_item->submenu) | ||
354 | - GTK_MENU_SHELL (menu_item->submenu)->ignore_enter = TRUE; | ||
355 | + GTK_MENU_SHELL (menu_item->submenu)->ignore_enter = TRUE; | ||
356 | } | ||
357 | |||
358 | GDK_THREADS_LEAVE (); | ||
359 | @@ -1002,7 +1103,16 @@ | ||
360 | g_source_remove (menu_item->timer); | ||
361 | menu_item->timer = 0; | ||
362 | |||
363 | + /* HILDON MOD. This is required as changed submenu arrow isn't drawn automatically | ||
364 | + * and drawing it must be requested. */ | ||
365 | + gtk_widget_queue_draw (widget); | ||
366 | + | ||
367 | if (GTK_WIDGET_IS_SENSITIVE (menu_item->submenu)) | ||
368 | + { | ||
369 | + gboolean take_focus; | ||
370 | + take_focus = gtk_menu_shell_get_take_focus (GTK_MENU_SHELL (widget->parent)); | ||
371 | + gtk_menu_shell_set_take_focus (GTK_MENU_SHELL (menu_item->submenu),take_focus); | ||
372 | + | ||
373 | gtk_menu_popup (GTK_MENU (menu_item->submenu), | ||
374 | widget->parent, | ||
375 | widget, | ||
376 | @@ -1010,6 +1120,28 @@ | ||
377 | menu_item, | ||
378 | GTK_MENU_SHELL (widget->parent)->button, | ||
379 | 0); | ||
380 | + } | ||
381 | +} | ||
382 | + | ||
383 | +void | ||
384 | +_gtk_menu_item_popdown_submenu (GtkWidget *widget) | ||
385 | +{ | ||
386 | + GtkMenuItem *menu_item; | ||
387 | + | ||
388 | + menu_item = GTK_MENU_ITEM (widget); | ||
389 | + | ||
390 | + if (menu_item->submenu) | ||
391 | + { | ||
392 | + if (menu_item->timer) | ||
393 | + { | ||
394 | + g_source_remove (menu_item->timer); | ||
395 | + menu_item->timer = 0; | ||
396 | + } | ||
397 | + else | ||
398 | + gtk_menu_popdown (GTK_MENU (menu_item->submenu)); | ||
399 | + } | ||
400 | + | ||
401 | + gtk_widget_queue_draw (widget); | ||
402 | } | ||
403 | |||
404 | static void | ||
405 | @@ -1092,14 +1224,17 @@ | ||
406 | tx += widget->allocation.width - twidth; | ||
407 | } | ||
408 | |||
409 | +/* HILDON modifications | ||
410 | + * Here we make the submenu of an menubar appear under the menubar. | ||
411 | + * The only exception is when the resulting menu would be under 100 pixels | ||
412 | + * high. In that case, the menu is made 100 pixels high. | ||
413 | + */ | ||
414 | if ((ty + widget->allocation.height + theight) <= monitor.y + monitor.height) | ||
415 | ty += widget->allocation.height; | ||
416 | - else if ((ty - theight) >= monitor.y) | ||
417 | - ty -= theight; | ||
418 | - else if (monitor.y + monitor.height - (ty + widget->allocation.height) > ty) | ||
419 | + else if ((ty + widget->allocation.height) < monitor.y + monitor.height - 120) | ||
420 | ty += widget->allocation.height; | ||
421 | else | ||
422 | - ty -= theight; | ||
423 | + ty = monitor.y + monitor.height - 120; | ||
424 | break; | ||
425 | |||
426 | case GTK_LEFT_RIGHT: | ||
427 | @@ -1404,3 +1539,30 @@ | ||
428 | |||
429 | return TRUE; | ||
430 | } | ||
431 | + | ||
432 | +/* Hildon modification : | ||
433 | + * This function exists only for opening submenus on | ||
434 | + * activation. */ | ||
435 | +static void | ||
436 | +_gtk_menu_item_activate_submenus (GtkMenuItem *item) | ||
437 | +{ | ||
438 | + GdkEvent *event; | ||
439 | + | ||
440 | + g_return_if_fail (GTK_IS_MENU_ITEM (item)); | ||
441 | + | ||
442 | + if (!GTK_IS_MENU (item->submenu) || | ||
443 | + GTK_WIDGET_VISIBLE (item->submenu)) | ||
444 | + return; | ||
445 | + | ||
446 | + event = gtk_get_current_event (); | ||
447 | + _gtk_menu_item_popup_submenu (item); | ||
448 | + | ||
449 | + /* We don't want to select first item if the submenu | ||
450 | + * is opened with mouse release because the selection | ||
451 | + * would move straigh back under the cursor. */ | ||
452 | + if ((event == NULL) || (event->type != GDK_BUTTON_RELEASE)) | ||
453 | + gtk_menu_shell_select_first (GTK_MENU_SHELL (item->submenu), TRUE); | ||
454 | + | ||
455 | + if (event) | ||
456 | + gdk_event_free (event); | ||
457 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenuitem.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenuitem.h.diff deleted file mode 100644 index cece91e70c..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenuitem.h.diff +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmenuitem.h 2004-12-15 18:27:30.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmenuitem.h 2005-04-06 16:19:36.983915952 +0300 | ||
3 | @@ -122,6 +122,7 @@ | ||
4 | gboolean group_changed); | ||
5 | gboolean _gtk_menu_item_is_selectable (GtkWidget *menu_item); | ||
6 | void _gtk_menu_item_popup_submenu (GtkWidget *menu_item); | ||
7 | +void _gtk_menu_item_popdown_submenu (GtkWidget *menu_item); | ||
8 | |||
9 | #ifndef GTK_DISABLE_DEPRECATED | ||
10 | #define gtk_menu_item_right_justify(menu_item) gtk_menu_item_set_right_justified ((menu_item), TRUE) | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenushell.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenushell.c.diff deleted file mode 100644 index 3534b7716d..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenushell.c.diff +++ /dev/null | |||
@@ -1,490 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmenushell.c 2005-02-09 18:46:54.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmenushell.c 2005-04-06 16:19:36.999913520 +0300 | ||
3 | @@ -39,6 +39,8 @@ | ||
4 | #include "gtkmnemonichash.h" | ||
5 | #include "gtktearoffmenuitem.h" | ||
6 | #include "gtkwindow.h" | ||
7 | +#include "gtkprivate.h" | ||
8 | +#include "gtkintl.h" | ||
9 | |||
10 | #define MENU_SHELL_TIMEOUT 500 | ||
11 | |||
12 | @@ -52,6 +54,11 @@ | ||
13 | LAST_SIGNAL | ||
14 | }; | ||
15 | |||
16 | +enum { | ||
17 | + PROP_0, | ||
18 | + PROP_TAKE_FOCUS | ||
19 | +}; | ||
20 | + | ||
21 | typedef void (*GtkMenuShellSignal1) (GtkObject *object, | ||
22 | GtkMenuDirectionType arg1, | ||
23 | gpointer data); | ||
24 | @@ -122,10 +129,20 @@ | ||
25 | { | ||
26 | GtkMnemonicHash *mnemonic_hash; | ||
27 | GtkKeyHash *key_hash; | ||
28 | + gboolean activated_submenu; | ||
29 | + gboolean take_focus; | ||
30 | }; | ||
31 | |||
32 | static void gtk_menu_shell_class_init (GtkMenuShellClass *klass); | ||
33 | static void gtk_menu_shell_init (GtkMenuShell *menu_shell); | ||
34 | +static void gtk_menu_shell_set_property (GObject *object, | ||
35 | + guint prop_id, | ||
36 | + const GValue *value, | ||
37 | + GParamSpec *pspec); | ||
38 | +static void gtk_menu_shell_get_property (GObject *object, | ||
39 | + guint prop_id, | ||
40 | + GValue *value, | ||
41 | + GParamSpec *pspec); | ||
42 | static void gtk_menu_shell_realize (GtkWidget *widget); | ||
43 | static void gtk_menu_shell_finalize (GObject *object); | ||
44 | static gint gtk_menu_shell_button_press (GtkWidget *widget, | ||
45 | @@ -176,7 +193,6 @@ | ||
46 | static GtkContainerClass *parent_class = NULL; | ||
47 | static guint menu_shell_signals[LAST_SIGNAL] = { 0 }; | ||
48 | |||
49 | - | ||
50 | GType | ||
51 | gtk_menu_shell_get_type (void) | ||
52 | { | ||
53 | @@ -220,6 +236,8 @@ | ||
54 | container_class = (GtkContainerClass*) klass; | ||
55 | |||
56 | parent_class = g_type_class_peek_parent (klass); | ||
57 | + object_class->set_property = gtk_menu_shell_set_property; | ||
58 | + object_class->get_property = gtk_menu_shell_get_property; | ||
59 | |||
60 | object_class->finalize = gtk_menu_shell_finalize; | ||
61 | |||
62 | @@ -299,9 +317,15 @@ | ||
63 | |||
64 | |||
65 | binding_set = gtk_binding_set_by_class (klass); | ||
66 | +/* Hildon : The following binding is commented out | ||
67 | + * because we want the Escape key to only exit the | ||
68 | + * currently opened submenu. Therefore, the handling | ||
69 | + * of esc-key will be moved to gtkmenuitem.c */ | ||
70 | +/* | ||
71 | gtk_binding_entry_add_signal (binding_set, | ||
72 | GDK_Escape, 0, | ||
73 | "cancel", 0); | ||
74 | +*/ | ||
75 | gtk_binding_entry_add_signal (binding_set, | ||
76 | GDK_Return, 0, | ||
77 | "activate_current", 1, | ||
78 | @@ -330,7 +354,23 @@ | ||
79 | GDK_F10, GDK_SHIFT_MASK, | ||
80 | "cycle_focus", 1, | ||
81 | GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD); | ||
82 | - | ||
83 | + /** | ||
84 | + * GtkMenuShell:take-focus: | ||
85 | + * | ||
86 | + * A boolean that determines whether the menu and its submenus grab the | ||
87 | + * keyboard focus. See gtk_menu_shell_set_take_focus() and | ||
88 | + * gtk_menu_shell_get_take_focus(). | ||
89 | + * | ||
90 | + * Since: 2.8 | ||
91 | + **/ | ||
92 | + g_object_class_install_property (object_class, | ||
93 | + PROP_TAKE_FOCUS, | ||
94 | + g_param_spec_boolean ("take-focus", | ||
95 | + P_("Take Focus"), | ||
96 | + P_("A boolean that determines whether the menu grabs the keyboard focus"), | ||
97 | + TRUE, | ||
98 | + G_PARAM_READWRITE)); | ||
99 | + | ||
100 | g_type_class_add_private (object_class, sizeof (GtkMenuShellPrivate)); | ||
101 | } | ||
102 | |||
103 | @@ -356,6 +396,46 @@ | ||
104 | |||
105 | priv->mnemonic_hash = NULL; | ||
106 | priv->key_hash = NULL; | ||
107 | + priv->take_focus = TRUE; | ||
108 | + priv->activated_submenu = FALSE; | ||
109 | +} | ||
110 | + | ||
111 | +static void | ||
112 | +gtk_menu_shell_set_property (GObject *object, | ||
113 | + guint prop_id, | ||
114 | + const GValue *value, | ||
115 | + GParamSpec *pspec) | ||
116 | +{ | ||
117 | + GtkMenuShell *menu_shell = GTK_MENU_SHELL (object); | ||
118 | + | ||
119 | + switch (prop_id) | ||
120 | + { | ||
121 | + case PROP_TAKE_FOCUS: | ||
122 | + gtk_menu_shell_set_take_focus (menu_shell, g_value_get_boolean (value)); | ||
123 | + break; | ||
124 | + default: | ||
125 | + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
126 | + break; | ||
127 | + } | ||
128 | +} | ||
129 | + | ||
130 | +static void | ||
131 | +gtk_menu_shell_get_property (GObject *object, | ||
132 | + guint prop_id, | ||
133 | + GValue *value, | ||
134 | + GParamSpec *pspec) | ||
135 | +{ | ||
136 | + GtkMenuShell *menu_shell = GTK_MENU_SHELL (object); | ||
137 | + | ||
138 | + switch (prop_id) | ||
139 | + { | ||
140 | + case PROP_TAKE_FOCUS: | ||
141 | + g_value_set_boolean (value, gtk_menu_shell_get_take_focus (menu_shell)); | ||
142 | + break; | ||
143 | + default: | ||
144 | + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
145 | + break; | ||
146 | + } | ||
147 | } | ||
148 | |||
149 | static void | ||
150 | @@ -470,6 +550,7 @@ | ||
151 | gtk_menu_shell_button_press (GtkWidget *widget, | ||
152 | GdkEventButton *event) | ||
153 | { | ||
154 | + GtkMenuShellPrivate *priv; | ||
155 | GtkMenuShell *menu_shell; | ||
156 | GtkWidget *menu_item; | ||
157 | |||
158 | @@ -479,7 +560,22 @@ | ||
159 | if (event->type != GDK_BUTTON_PRESS) | ||
160 | return FALSE; | ||
161 | |||
162 | + priv = GTK_MENU_SHELL_GET_PRIVATE (widget); | ||
163 | + | ||
164 | menu_shell = GTK_MENU_SHELL (widget); | ||
165 | + menu_item = gtk_menu_shell_get_item (menu_shell, (GdkEvent*) event); | ||
166 | + | ||
167 | + if (menu_shell->active && menu_item && | ||
168 | + (menu_shell->active_menu_item == menu_item) && | ||
169 | + _gtk_menu_item_is_selectable (menu_item) && | ||
170 | + GTK_MENU_ITEM (menu_item)->submenu != NULL && | ||
171 | + !GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_item)->submenu)) | ||
172 | + { | ||
173 | + /* Hildon : We want to be able to activate submenu items. */ | ||
174 | + gtk_menu_shell_activate_item (menu_shell, menu_item, FALSE); | ||
175 | + | ||
176 | + priv->activated_submenu = TRUE; | ||
177 | + } | ||
178 | |||
179 | if (menu_shell->parent_menu_shell) | ||
180 | { | ||
181 | @@ -491,30 +587,29 @@ | ||
182 | |||
183 | menu_shell->button = event->button; | ||
184 | |||
185 | - menu_item = gtk_menu_shell_get_item (menu_shell, (GdkEvent *)event); | ||
186 | - | ||
187 | if (menu_item && _gtk_menu_item_is_selectable (menu_item)) | ||
188 | - { | ||
189 | - if ((menu_item->parent == widget) && | ||
190 | - (menu_item != menu_shell->active_menu_item)) | ||
191 | - { | ||
192 | - if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM) | ||
193 | - { | ||
194 | - menu_shell->activate_time = event->time; | ||
195 | - } | ||
196 | + { | ||
197 | + | ||
198 | + if ((menu_item->parent == widget) && | ||
199 | + (menu_item != menu_shell->active_menu_item)) | ||
200 | + { | ||
201 | + if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM) | ||
202 | + { | ||
203 | + menu_shell->activate_time = event->time; | ||
204 | + } | ||
205 | |||
206 | - gtk_menu_shell_select_item (menu_shell, menu_item); | ||
207 | - } | ||
208 | - } | ||
209 | + gtk_menu_shell_select_item (menu_shell, menu_item); | ||
210 | + } | ||
211 | + } | ||
212 | } | ||
213 | else | ||
214 | { | ||
215 | widget = gtk_get_event_widget ((GdkEvent*) event); | ||
216 | if (widget == GTK_WIDGET (menu_shell)) | ||
217 | - { | ||
218 | - gtk_menu_shell_deactivate (menu_shell); | ||
219 | - g_signal_emit (menu_shell, menu_shell_signals[SELECTION_DONE], 0); | ||
220 | - } | ||
221 | + { | ||
222 | + gtk_menu_shell_deactivate (menu_shell); | ||
223 | + g_signal_emit (menu_shell, menu_shell_signals[SELECTION_DONE], 0); | ||
224 | + } | ||
225 | } | ||
226 | |||
227 | return TRUE; | ||
228 | @@ -524,13 +619,20 @@ | ||
229 | gtk_menu_shell_button_release (GtkWidget *widget, | ||
230 | GdkEventButton *event) | ||
231 | { | ||
232 | + GtkMenuShellPrivate *priv; | ||
233 | GtkMenuShell *menu_shell; | ||
234 | GtkWidget *menu_item; | ||
235 | gint deactivate; | ||
236 | + gboolean activated_submenu; | ||
237 | |||
238 | g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), FALSE); | ||
239 | g_return_val_if_fail (event != NULL, FALSE); | ||
240 | |||
241 | + priv = GTK_MENU_SHELL_GET_PRIVATE (widget); | ||
242 | + | ||
243 | + activated_submenu = priv->activated_submenu; | ||
244 | + priv->activated_submenu = FALSE; | ||
245 | + | ||
246 | menu_shell = GTK_MENU_SHELL (widget); | ||
247 | if (menu_shell->active) | ||
248 | { | ||
249 | @@ -556,11 +658,11 @@ | ||
250 | gtk_menu_shell_activate_item (menu_shell, menu_item, TRUE); | ||
251 | return TRUE; | ||
252 | } | ||
253 | - else if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement != GTK_TOP_BOTTOM) | ||
254 | - { | ||
255 | - gtk_menu_item_select (GTK_MENU_ITEM (menu_item)); | ||
256 | - return TRUE; | ||
257 | - } | ||
258 | + else if (!activated_submenu) | ||
259 | + { | ||
260 | + /* popdown the submenu if we didn't pop it up in this click */ | ||
261 | + _gtk_menu_item_popdown_submenu (menu_item); | ||
262 | + } | ||
263 | } | ||
264 | else if (menu_item && | ||
265 | !_gtk_menu_item_is_selectable (menu_item) && | ||
266 | @@ -630,12 +732,14 @@ | ||
267 | gtk_menu_shell_enter_notify (GtkWidget *widget, | ||
268 | GdkEventCrossing *event) | ||
269 | { | ||
270 | + GtkMenuShellPrivate *priv; | ||
271 | GtkMenuShell *menu_shell; | ||
272 | GtkWidget *menu_item; | ||
273 | |||
274 | g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), FALSE); | ||
275 | g_return_val_if_fail (event != NULL, FALSE); | ||
276 | |||
277 | + priv = GTK_MENU_SHELL_GET_PRIVATE (widget); | ||
278 | menu_shell = GTK_MENU_SHELL (widget); | ||
279 | |||
280 | if (menu_shell->active) | ||
281 | @@ -658,6 +762,17 @@ | ||
282 | (GTK_WIDGET_STATE (menu_item) != GTK_STATE_PRELIGHT)) | ||
283 | { | ||
284 | gtk_menu_shell_select_item (menu_shell, menu_item); | ||
285 | + | ||
286 | + /* If the pen is down, and there is a submenu that is not | ||
287 | + * yet visible, activate it */ | ||
288 | + if ((event->state & GDK_BUTTON1_MASK) && | ||
289 | + GTK_MENU_ITEM (menu_item)->submenu != NULL && | ||
290 | + !GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_item)->submenu)) | ||
291 | + { | ||
292 | + gtk_menu_shell_activate_item (menu_shell, menu_item, FALSE); | ||
293 | + | ||
294 | + priv->activated_submenu = TRUE; | ||
295 | + } | ||
296 | } | ||
297 | } | ||
298 | else if (menu_shell->parent_menu_shell) | ||
299 | @@ -887,8 +1002,14 @@ | ||
300 | /* This allows the bizarre radio buttons-with-submenus-display-history | ||
301 | * behavior | ||
302 | */ | ||
303 | + /* Hildon modification. We probably won't have those | ||
304 | + * bizarre radio buttons-with-submenus so we don't | ||
305 | + * need this. Also, this functionality interferes with | ||
306 | + * other functionality. */ | ||
307 | +/* | ||
308 | if (GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu) | ||
309 | gtk_widget_activate (menu_shell->active_menu_item); | ||
310 | +*/ | ||
311 | } | ||
312 | |||
313 | void | ||
314 | @@ -919,7 +1040,9 @@ | ||
315 | |||
316 | g_object_ref (menu_shell); | ||
317 | |||
318 | - if (deactivate) | ||
319 | + /* We don't want to deactivate if we're activating | ||
320 | + * a submenu item. */ | ||
321 | + if ((deactivate) && (GTK_MENU_ITEM (menu_item)->submenu == NULL)) | ||
322 | { | ||
323 | GtkMenuShell *parent_menu_shell = menu_shell; | ||
324 | |||
325 | @@ -965,29 +1088,30 @@ | ||
326 | |||
327 | if (distance > 0) | ||
328 | { | ||
329 | + /*Hildon: selection no longer wraps around at the | ||
330 | + *bottom of the menu*/ | ||
331 | + | ||
332 | node = node->next; | ||
333 | - while (node != start_node && | ||
334 | - (!node || !_gtk_menu_item_is_selectable (node->data))) | ||
335 | + while (node && node != start_node && | ||
336 | + !_gtk_menu_item_is_selectable (node->data)) | ||
337 | { | ||
338 | - if (!node) | ||
339 | - node = menu_shell->children; | ||
340 | - else | ||
341 | node = node->next; | ||
342 | } | ||
343 | } | ||
344 | else | ||
345 | { | ||
346 | + /*Hildon: selection no longer wraps around at the top | ||
347 | + *of the menu*/ | ||
348 | + | ||
349 | node = node->prev; | ||
350 | - while (node != start_node && | ||
351 | - (!node || !_gtk_menu_item_is_selectable (node->data))) | ||
352 | + while (node && node != start_node && | ||
353 | + !_gtk_menu_item_is_selectable (node->data)) | ||
354 | { | ||
355 | - if (!node) | ||
356 | - node = g_list_last (menu_shell->children); | ||
357 | - else | ||
358 | node = node->prev; | ||
359 | } | ||
360 | } | ||
361 | |||
362 | + /*note: gtk_menu_shell_select_item won't select non-selectable items*/ | ||
363 | if (node) | ||
364 | gtk_menu_shell_select_item (menu_shell, node->data); | ||
365 | } | ||
366 | @@ -1119,6 +1243,16 @@ | ||
367 | switch (direction) | ||
368 | { | ||
369 | case GTK_MENU_DIR_PARENT: | ||
370 | + | ||
371 | + if(!parent_menu_shell || GTK_IS_MENU_BAR(parent_menu_shell)) | ||
372 | + break; | ||
373 | + | ||
374 | + /* hildon-modification - menu should be closed when returning from submenu. | ||
375 | + * WARNING: This function is from GtkMenu, which normally | ||
376 | + * shouldn't be called from GtkMenuShell, but currently | ||
377 | + * there are no better alternatives. */ | ||
378 | + gtk_menu_popdown (GTK_MENU (menu_shell)); | ||
379 | + | ||
380 | if (parent_menu_shell) | ||
381 | { | ||
382 | if (GTK_MENU_SHELL_GET_CLASS (parent_menu_shell)->submenu_placement == | ||
383 | @@ -1151,10 +1285,14 @@ | ||
384 | _gtk_menu_item_is_selectable (menu_shell->active_menu_item) && | ||
385 | GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu) | ||
386 | { | ||
387 | + /* Hildon-modification -- submenu is not opened automatically but needs to be explicitly opened*/ | ||
388 | + g_signal_emit (G_OBJECT (menu_shell), menu_shell_signals[ACTIVATE_CURRENT], 0, (gint) FALSE); | ||
389 | + | ||
390 | if (gtk_menu_shell_select_submenu_first (menu_shell)) | ||
391 | break; | ||
392 | } | ||
393 | |||
394 | +#if 0 | ||
395 | /* Try to find a menu running the opposite direction */ | ||
396 | while (parent_menu_shell && | ||
397 | (GTK_MENU_SHELL_GET_CLASS (parent_menu_shell)->submenu_placement == | ||
398 | @@ -1173,6 +1311,7 @@ | ||
399 | gtk_menu_shell_move_selected (parent_menu_shell, 1); | ||
400 | gtk_menu_shell_select_submenu_first (parent_menu_shell); | ||
401 | } | ||
402 | +#endif | ||
403 | break; | ||
404 | |||
405 | case GTK_MENU_DIR_PREV: | ||
406 | @@ -1197,8 +1336,8 @@ | ||
407 | gtk_real_menu_shell_activate_current (GtkMenuShell *menu_shell, | ||
408 | gboolean force_hide) | ||
409 | { | ||
410 | - if (menu_shell->active_menu_item && | ||
411 | - _gtk_menu_item_is_selectable (menu_shell->active_menu_item)) | ||
412 | + if (menu_shell->active_menu_item)/* && | ||
413 | + _gtk_menu_item_is_selectable (menu_shell->active_menu_item)) */ | ||
414 | { | ||
415 | |||
416 | if (GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu == NULL) | ||
417 | @@ -1390,4 +1529,73 @@ | ||
418 | keyval, target); | ||
419 | gtk_menu_shell_reset_key_hash (menu_shell); | ||
420 | } | ||
421 | +/** | ||
422 | + * gtk_menu_shell_get_take_focus: | ||
423 | + * @menu: a #GtkMenuShell | ||
424 | + * | ||
425 | + * @returns: %TRUE if the menu_shell will take the keyboard focus on popup. | ||
426 | + * | ||
427 | + * Since: 2.8 | ||
428 | + **/ | ||
429 | +gboolean | ||
430 | +gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell) | ||
431 | +{ | ||
432 | + GtkMenuShellPrivate *priv; | ||
433 | + | ||
434 | + g_return_val_if_fail (GTK_IS_MENU_SHELL (menu_shell), FALSE); | ||
435 | + | ||
436 | + priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell); | ||
437 | + | ||
438 | + return priv->take_focus; | ||
439 | +} | ||
440 | + | ||
441 | +/** | ||
442 | + * gtk_menu_shell_set_take_focus: | ||
443 | + * @menu: a #GtkMenuShell | ||
444 | + * @take_focus: %TRUE if the menu_shell should take the keyboard focus on popup. | ||
445 | + * | ||
446 | + * If @take_focus is %TRUE (the default) the menu will take the keyboard focus | ||
447 | + * so that it will receive all keyboard events which is needed to enable | ||
448 | + * keyboard navigation in menus. | ||
449 | + * | ||
450 | + * Setting @take_focus to %FALSE is useful only for special applications | ||
451 | + * like virtual keyboard implementations which should not take keyboard | ||
452 | + * focus. | ||
453 | + * | ||
454 | + * The @take_focus state of a menu or menu bar is automatically propagated | ||
455 | + * to submenus whenever a submenu is popped up, so you don't have to worry | ||
456 | + * about recursively setting it for your entire menu hierarchy. Only when | ||
457 | + * programmatically picking a submenu and popping it up manually, the | ||
458 | + * @take_focus property of the submenu needs to be set explicitely. | ||
459 | + * | ||
460 | + * Note that setting it to %FALSE has side-effects: | ||
461 | + * | ||
462 | + * If the focus is in some other app, it keeps the focus and keynav in | ||
463 | + * the menu doesn't work. Consequently, keynav on the menu will only | ||
464 | + * work if the focus is on some toplevel owned by the onscreen keyboard. | ||
465 | + * | ||
466 | + * To avoid confusing the user, menus with @take_focus set to %FALSE | ||
467 | + * should not display mnemonics or accelerators, since it cannot be | ||
468 | + * guaranteed that they will work. | ||
469 | + * | ||
470 | + * See also gdk_keyboard_grab() | ||
471 | + * | ||
472 | + * Since: 2.8 | ||
473 | + **/ | ||
474 | +void | ||
475 | +gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell, | ||
476 | + gboolean take_focus) | ||
477 | +{ | ||
478 | + GtkMenuShellPrivate *priv; | ||
479 | + | ||
480 | + g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell)); | ||
481 | + | ||
482 | + priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell); | ||
483 | + | ||
484 | + if (priv->take_focus != take_focus) | ||
485 | + { | ||
486 | + priv->take_focus = take_focus; | ||
487 | + g_object_notify (G_OBJECT (menu_shell), "take-focus"); | ||
488 | + } | ||
489 | +} | ||
490 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenushell.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenushell.h.diff deleted file mode 100644 index 4bd7fc547c..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkmenushell.h.diff +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkmenushell.h 2004-12-11 00:09:22.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkmenushell.h 2005-04-06 16:19:36.999913520 +0300 | ||
3 | @@ -124,6 +124,9 @@ | ||
4 | void _gtk_menu_shell_remove_mnemonic (GtkMenuShell *menu_shell, | ||
5 | guint keyval, | ||
6 | GtkWidget *target); | ||
7 | +gboolean gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell); | ||
8 | +void gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell, | ||
9 | + gboolean take_focus); | ||
10 | |||
11 | #ifdef __cplusplus | ||
12 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtknotebook.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtknotebook.c.diff deleted file mode 100644 index 4f75106938..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtknotebook.c.diff +++ /dev/null | |||
@@ -1,831 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtknotebook.c 2004-09-27 06:43:55.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtknotebook.c 2005-04-06 16:19:37.033908352 +0300 | ||
3 | @@ -40,10 +40,10 @@ | ||
4 | |||
5 | #define TAB_OVERLAP 2 | ||
6 | #define TAB_CURVATURE 1 | ||
7 | -#define ARROW_SIZE 12 | ||
8 | +#define ARROW_WIDTH 20 | ||
9 | +#define ARROW_HEIGHT 27 | ||
10 | #define ARROW_SPACING 0 | ||
11 | -#define NOTEBOOK_INIT_SCROLL_DELAY (200) | ||
12 | -#define NOTEBOOK_SCROLL_DELAY (100) | ||
13 | +#define LABEL_PADDING 0 | ||
14 | |||
15 | |||
16 | enum { | ||
17 | @@ -57,7 +57,9 @@ | ||
18 | |||
19 | enum { | ||
20 | STEP_PREV, | ||
21 | - STEP_NEXT | ||
22 | + STEP_NEXT, | ||
23 | + STEP_PREV_CYCLE, | ||
24 | + STEP_NEXT_CYCLE | ||
25 | }; | ||
26 | |||
27 | typedef enum | ||
28 | @@ -216,7 +218,7 @@ | ||
29 | GList *list, | ||
30 | gboolean destroying); | ||
31 | static void gtk_notebook_update_labels (GtkNotebook *notebook); | ||
32 | -static gint gtk_notebook_timer (GtkNotebook *notebook); | ||
33 | +static gint gtk_notebook_timer (GtkNotebook *notebook ); | ||
34 | static gint gtk_notebook_page_compare (gconstpointer a, | ||
35 | gconstpointer b); | ||
36 | static GList* gtk_notebook_find_child (GtkNotebook *notebook, | ||
37 | @@ -458,7 +460,7 @@ | ||
38 | g_param_spec_boolean ("scrollable", | ||
39 | P_("Scrollable"), | ||
40 | P_("If TRUE, scroll arrows are added if there are too many tabs to fit"), | ||
41 | - FALSE, | ||
42 | + TRUE, | ||
43 | G_PARAM_READWRITE)); | ||
44 | g_object_class_install_property (gobject_class, | ||
45 | PROP_ENABLE_POPUP, | ||
46 | @@ -584,6 +586,75 @@ | ||
47 | |||
48 | G_PARAM_READABLE)); | ||
49 | |||
50 | + /* Hildon: for adding paddings to the inner borders of the visible page */ | ||
51 | + gtk_widget_class_install_style_property (widget_class, | ||
52 | + g_param_spec_int ("inner_left_border", | ||
53 | + _("Inner left border of the visible page"), | ||
54 | + _("Width of inner left border of the visible page"), | ||
55 | + 0, | ||
56 | + G_MAXINT, | ||
57 | + 0, | ||
58 | + G_PARAM_READABLE)); | ||
59 | + gtk_widget_class_install_style_property (widget_class, | ||
60 | + g_param_spec_int ("inner_right_border", | ||
61 | + _("Inner right border of the visible page"), | ||
62 | + _("Width of inner right border of the visible page"), | ||
63 | + 0, | ||
64 | + G_MAXINT, | ||
65 | + 0, | ||
66 | + G_PARAM_READABLE)); | ||
67 | + | ||
68 | + /* Hildon: previously hardcoded constants ARROW_WIDTH, ARROW_HEIGHT, | ||
69 | + ARROW_SPACING, TAB_OVERLAP and TAB_CURVATURE are now style properties */ | ||
70 | + gtk_widget_class_install_style_property (widget_class, | ||
71 | + g_param_spec_int ("arrow-width", | ||
72 | + _("Arrow width"), | ||
73 | + _("Scroll arrow width"), | ||
74 | + 0, | ||
75 | + G_MAXINT, | ||
76 | + ARROW_WIDTH, | ||
77 | + G_PARAM_READABLE)); | ||
78 | + gtk_widget_class_install_style_property (widget_class, | ||
79 | + g_param_spec_int ("arrow-height", | ||
80 | + _("Arrow height"), | ||
81 | + _("Scroll arrow height"), | ||
82 | + 0, | ||
83 | + G_MAXINT, | ||
84 | + ARROW_HEIGHT, | ||
85 | + G_PARAM_READABLE)); | ||
86 | + gtk_widget_class_install_style_property (widget_class, | ||
87 | + g_param_spec_int ("arrow-spacing", | ||
88 | + _("Arrow spacing"), | ||
89 | + _("Scroll arrow spacing"), | ||
90 | + 0, | ||
91 | + G_MAXINT, | ||
92 | + ARROW_SPACING, | ||
93 | + G_PARAM_READABLE)); | ||
94 | + gtk_widget_class_install_style_property (widget_class, | ||
95 | + g_param_spec_int ("tab-overlap", | ||
96 | + _("Tab overlap"), | ||
97 | + _("Tab overlap"), | ||
98 | + 0, | ||
99 | + G_MAXINT, | ||
100 | + TAB_OVERLAP, | ||
101 | + G_PARAM_READABLE)); | ||
102 | + gtk_widget_class_install_style_property (widget_class, | ||
103 | + g_param_spec_int ("tab-curvature", | ||
104 | + _("Tab curvature"), | ||
105 | + _("Tab curvature"), | ||
106 | + 0, | ||
107 | + G_MAXINT, | ||
108 | + TAB_CURVATURE, | ||
109 | + G_PARAM_READABLE)); | ||
110 | + gtk_widget_class_install_style_property (widget_class, | ||
111 | + g_param_spec_int ("label-padding", | ||
112 | + _("Label padding"), | ||
113 | + _("Label padding"), | ||
114 | + 0, | ||
115 | + G_MAXINT, | ||
116 | + LABEL_PADDING, | ||
117 | + G_PARAM_READABLE)); | ||
118 | + | ||
119 | notebook_signals[SWITCH_PAGE] = | ||
120 | g_signal_new ("switch_page", | ||
121 | G_TYPE_FROM_CLASS (gobject_class), | ||
122 | @@ -705,11 +776,10 @@ | ||
123 | notebook->show_tabs = TRUE; | ||
124 | notebook->show_border = TRUE; | ||
125 | notebook->tab_pos = GTK_POS_TOP; | ||
126 | - notebook->scrollable = FALSE; | ||
127 | + notebook->scrollable = TRUE; | ||
128 | notebook->in_child = 0; | ||
129 | notebook->click_child = 0; | ||
130 | notebook->button = 0; | ||
131 | - notebook->need_timer = 0; | ||
132 | notebook->child_has_focus = FALSE; | ||
133 | notebook->have_visible_child = FALSE; | ||
134 | notebook->focus_out = FALSE; | ||
135 | @@ -1189,9 +1259,18 @@ | ||
136 | GtkRequisition child_requisition; | ||
137 | gboolean switch_page = FALSE; | ||
138 | gint vis_pages; | ||
139 | - gint focus_width; | ||
140 | + gint focus_width, label_padding; | ||
141 | + gint arrow_width, arrow_height, arrow_spacing, tab_overlap, tab_curvature; | ||
142 | |||
143 | - gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL); | ||
144 | + gtk_widget_style_get (widget, | ||
145 | + "focus-line-width", &focus_width, | ||
146 | + "arrow-width", &arrow_width, | ||
147 | + "arrow-height", &arrow_height, | ||
148 | + "arrow-spacing", &arrow_spacing, | ||
149 | + "tab-overlap", &tab_overlap, | ||
150 | + "tab-curvature", &tab_curvature, | ||
151 | + "label-padding", &label_padding, | ||
152 | + NULL); | ||
153 | |||
154 | widget->requisition.width = 0; | ||
155 | widget->requisition.height = 0; | ||
156 | @@ -1229,6 +1308,22 @@ | ||
157 | { | ||
158 | widget->requisition.width += widget->style->xthickness * 2; | ||
159 | widget->requisition.height += widget->style->ythickness * 2; | ||
160 | + | ||
161 | + /* Hildon kludge: inner border paddings */ | ||
162 | + if (notebook->children && notebook->show_border) | ||
163 | + { | ||
164 | + gint inner_left_border, inner_right_border; | ||
165 | + | ||
166 | + gtk_widget_style_get (widget, | ||
167 | + "inner_left_border", | ||
168 | + &inner_left_border, | ||
169 | + "inner_right_border", | ||
170 | + &inner_right_border, | ||
171 | + NULL); | ||
172 | + | ||
173 | + widget->requisition.width += inner_left_border + inner_right_border; | ||
174 | + } | ||
175 | + | ||
176 | |||
177 | if (notebook->show_tabs) | ||
178 | { | ||
179 | @@ -1249,6 +1344,7 @@ | ||
180 | |||
181 | gtk_widget_size_request (page->tab_label, | ||
182 | &child_requisition); | ||
183 | + child_requisition.width += 2 * label_padding; | ||
184 | |||
185 | page->requisition.width = | ||
186 | child_requisition.width + | ||
187 | @@ -1292,10 +1388,10 @@ | ||
188 | |||
189 | if (notebook->scrollable && vis_pages > 1 && | ||
190 | widget->requisition.width < tab_width) | ||
191 | - tab_height = MAX (tab_height, ARROW_SIZE); | ||
192 | + tab_height = MAX (tab_height, arrow_height); | ||
193 | |||
194 | - padding = 2 * (TAB_CURVATURE + focus_width + | ||
195 | - notebook->tab_hborder) - TAB_OVERLAP; | ||
196 | + padding = 2 * (tab_curvature + focus_width + | ||
197 | + notebook->tab_hborder) - tab_overlap; | ||
198 | tab_max += padding; | ||
199 | while (children) | ||
200 | { | ||
201 | @@ -1316,15 +1412,15 @@ | ||
202 | |||
203 | if (notebook->scrollable && vis_pages > 1 && | ||
204 | widget->requisition.width < tab_width) | ||
205 | - tab_width = tab_max + 2 * (ARROW_SIZE + ARROW_SPACING); | ||
206 | + tab_width = tab_max + 2 * (arrow_width + arrow_spacing); | ||
207 | |||
208 | if (notebook->homogeneous && !notebook->scrollable) | ||
209 | widget->requisition.width = MAX (widget->requisition.width, | ||
210 | vis_pages * tab_max + | ||
211 | - TAB_OVERLAP); | ||
212 | + tab_overlap); | ||
213 | else | ||
214 | widget->requisition.width = MAX (widget->requisition.width, | ||
215 | - tab_width + TAB_OVERLAP); | ||
216 | + tab_width + tab_overlap); | ||
217 | |||
218 | widget->requisition.height += tab_height; | ||
219 | break; | ||
220 | @@ -1335,10 +1431,10 @@ | ||
221 | |||
222 | if (notebook->scrollable && vis_pages > 1 && | ||
223 | widget->requisition.height < tab_height) | ||
224 | - tab_width = MAX (tab_width, ARROW_SPACING + 2 * ARROW_SIZE); | ||
225 | + tab_width = MAX (tab_width, arrow_spacing + 2 * arrow_width); | ||
226 | |||
227 | - padding = 2 * (TAB_CURVATURE + focus_width + | ||
228 | - notebook->tab_vborder) - TAB_OVERLAP; | ||
229 | + padding = 2 * (tab_curvature + focus_width + | ||
230 | + notebook->tab_vborder) - tab_overlap; | ||
231 | tab_max += padding; | ||
232 | |||
233 | while (children) | ||
234 | @@ -1361,24 +1457,24 @@ | ||
235 | |||
236 | if (notebook->scrollable && vis_pages > 1 && | ||
237 | widget->requisition.height < tab_height) | ||
238 | - tab_height = tab_max + ARROW_SIZE + ARROW_SPACING; | ||
239 | + tab_height = tab_max + arrow_height + arrow_spacing; | ||
240 | |||
241 | widget->requisition.width += tab_width; | ||
242 | |||
243 | if (notebook->homogeneous && !notebook->scrollable) | ||
244 | widget->requisition.height = | ||
245 | MAX (widget->requisition.height, | ||
246 | - vis_pages * tab_max + TAB_OVERLAP); | ||
247 | + vis_pages * tab_max + tab_overlap); | ||
248 | else | ||
249 | widget->requisition.height = | ||
250 | MAX (widget->requisition.height, | ||
251 | - tab_height + TAB_OVERLAP); | ||
252 | + tab_height + tab_overlap); | ||
253 | |||
254 | if (!notebook->homogeneous || notebook->scrollable) | ||
255 | vis_pages = 1; | ||
256 | widget->requisition.height = MAX (widget->requisition.height, | ||
257 | vis_pages * tab_max + | ||
258 | - TAB_OVERLAP); | ||
259 | + tab_overlap); | ||
260 | break; | ||
261 | } | ||
262 | } | ||
263 | @@ -1499,7 +1595,26 @@ | ||
264 | } | ||
265 | } | ||
266 | |||
267 | + /* Hildon kludge: inner border paddings */ | ||
268 | + if (notebook->show_border) | ||
269 | + { | ||
270 | + gint inner_left_border, inner_right_border; | ||
271 | + | ||
272 | + gtk_widget_style_get (widget, | ||
273 | + "inner_left_border", | ||
274 | + &inner_left_border, | ||
275 | + "inner_right_border", | ||
276 | + &inner_right_border, | ||
277 | + NULL); | ||
278 | + | ||
279 | + child_allocation.x += inner_left_border; | ||
280 | + child_allocation.width -= inner_left_border + inner_right_border; | ||
281 | + if (child_allocation.width < 0) | ||
282 | + child_allocation.width = 0; | ||
283 | + } | ||
284 | + | ||
285 | children = notebook->children; | ||
286 | + | ||
287 | while (children) | ||
288 | { | ||
289 | page = children->data; | ||
290 | @@ -1580,11 +1695,18 @@ | ||
291 | GdkRectangle event_window_pos; | ||
292 | gboolean before = ARROW_IS_BEFORE (arrow); | ||
293 | gboolean left = ARROW_IS_LEFT (arrow); | ||
294 | + gint arrow_width, arrow_height, arrow_spacing; | ||
295 | + | ||
296 | + gtk_widget_style_get (GTK_WIDGET(notebook), | ||
297 | + "arrow-width", &arrow_width, | ||
298 | + "arrow-height", &arrow_height, | ||
299 | + "arrow-spacing", &arrow_spacing, | ||
300 | + NULL); | ||
301 | |||
302 | if (gtk_notebook_get_event_window_position (notebook, &event_window_pos)) | ||
303 | { | ||
304 | - rectangle->width = ARROW_SIZE; | ||
305 | - rectangle->height = ARROW_SIZE; | ||
306 | + rectangle->width = arrow_width; | ||
307 | + rectangle->height = arrow_height; | ||
308 | |||
309 | switch (notebook->tab_pos) | ||
310 | { | ||
311 | @@ -1602,6 +1724,8 @@ | ||
312 | rectangle->y += event_window_pos.height - rectangle->height; | ||
313 | break; | ||
314 | case GTK_POS_TOP: | ||
315 | + arrow_spacing = - arrow_spacing; | ||
316 | + /* Fall through */ | ||
317 | case GTK_POS_BOTTOM: | ||
318 | if (before) | ||
319 | { | ||
320 | @@ -1617,7 +1741,11 @@ | ||
321 | else | ||
322 | rectangle->x = event_window_pos.x + event_window_pos.width - 2 * rectangle->width; | ||
323 | } | ||
324 | - rectangle->y = event_window_pos.y + (event_window_pos.height - rectangle->height) / 2; | ||
325 | + rectangle->y = event_window_pos.y; | ||
326 | + if (arrow_spacing > 0) | ||
327 | + rectangle->y += arrow_spacing; | ||
328 | + else | ||
329 | + rectangle->y += (event_window_pos.height - rectangle->height) / 2; | ||
330 | break; | ||
331 | } | ||
332 | } | ||
333 | @@ -1696,6 +1824,10 @@ | ||
334 | gboolean is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL; | ||
335 | gboolean left = (ARROW_IS_LEFT (arrow) && !is_rtl) || | ||
336 | (!ARROW_IS_LEFT (arrow) && is_rtl); | ||
337 | + GtkSettings *settings = gtk_settings_get_default (); | ||
338 | + guint timeout; | ||
339 | + | ||
340 | + g_object_get (settings, "gtk-initial-timeout", &timeout, NULL); | ||
341 | |||
342 | if (!GTK_WIDGET_HAS_FOCUS (widget)) | ||
343 | gtk_widget_grab_focus (widget); | ||
344 | @@ -1706,14 +1838,14 @@ | ||
345 | if (event->button == 1) | ||
346 | { | ||
347 | gtk_notebook_do_arrow (notebook, arrow); | ||
348 | - | ||
349 | + | ||
350 | if (!notebook->timer) | ||
351 | - { | ||
352 | - notebook->timer = g_timeout_add (NOTEBOOK_INIT_SCROLL_DELAY, | ||
353 | - (GSourceFunc) gtk_notebook_timer, | ||
354 | - (gpointer) notebook); | ||
355 | - notebook->need_timer = TRUE; | ||
356 | - } | ||
357 | + { | ||
358 | + notebook->timer = g_timeout_add (timeout, | ||
359 | + (GSourceFunc) gtk_notebook_timer, | ||
360 | + (gpointer) notebook); | ||
361 | + notebook->need_timer = TRUE; | ||
362 | + } | ||
363 | } | ||
364 | else if (event->button == 2) | ||
365 | gtk_notebook_page_select (notebook, TRUE); | ||
366 | @@ -1862,7 +1994,7 @@ | ||
367 | static void | ||
368 | stop_scrolling (GtkNotebook *notebook) | ||
369 | { | ||
370 | - if (notebook->timer) | ||
371 | + if (notebook->timer) | ||
372 | { | ||
373 | g_source_remove (notebook->timer); | ||
374 | notebook->timer = 0; | ||
375 | @@ -2343,9 +2475,9 @@ | ||
376 | */ | ||
377 | return focus_child_in (notebook, GTK_DIR_TAB_FORWARD); | ||
378 | case GTK_DIR_LEFT: | ||
379 | - return focus_tabs_move (notebook, direction, STEP_PREV); | ||
380 | + return focus_tabs_move (notebook, direction, STEP_PREV_CYCLE); | ||
381 | case GTK_DIR_RIGHT: | ||
382 | - return focus_tabs_move (notebook, direction, STEP_NEXT); | ||
383 | + return focus_tabs_move (notebook, direction, STEP_NEXT_CYCLE); | ||
384 | } | ||
385 | } | ||
386 | else /* Focus was not on widget */ | ||
387 | @@ -2481,7 +2613,6 @@ | ||
388 | * gtk_notebook_redraw_tabs | ||
389 | * gtk_notebook_real_remove | ||
390 | * gtk_notebook_update_labels | ||
391 | - * gtk_notebook_timer | ||
392 | * gtk_notebook_page_compare | ||
393 | * gtk_notebook_real_page_position | ||
394 | * gtk_notebook_search_page | ||
395 | @@ -2574,22 +2705,27 @@ | ||
396 | gtk_notebook_timer (GtkNotebook *notebook) | ||
397 | { | ||
398 | gboolean retval = FALSE; | ||
399 | + guint timeout; | ||
400 | + GtkSettings *settings; | ||
401 | |||
402 | GDK_THREADS_ENTER (); | ||
403 | |||
404 | + settings = gtk_settings_get_default (); | ||
405 | + g_object_get (settings, "gtk-update-timeout", &timeout, NULL); | ||
406 | + | ||
407 | if (notebook->timer) | ||
408 | { | ||
409 | gtk_notebook_do_arrow (notebook, notebook->click_child); | ||
410 | |||
411 | - if (notebook->need_timer) | ||
412 | - { | ||
413 | - notebook->need_timer = FALSE; | ||
414 | - notebook->timer = g_timeout_add (NOTEBOOK_SCROLL_DELAY, | ||
415 | - (GSourceFunc) gtk_notebook_timer, | ||
416 | - (gpointer) notebook); | ||
417 | - } | ||
418 | + if (notebook->need_timer) | ||
419 | + { | ||
420 | + notebook->need_timer = FALSE; | ||
421 | + notebook->timer = g_timeout_add (timeout, | ||
422 | + (GSourceFunc) gtk_notebook_timer, | ||
423 | + (gpointer) notebook); | ||
424 | + } | ||
425 | else | ||
426 | - retval = TRUE; | ||
427 | + retval = TRUE; | ||
428 | } | ||
429 | |||
430 | GDK_THREADS_LEAVE (); | ||
431 | @@ -2781,10 +2917,12 @@ | ||
432 | switch (direction) | ||
433 | { | ||
434 | case STEP_PREV: | ||
435 | + case STEP_PREV_CYCLE: | ||
436 | flag = GTK_PACK_END; | ||
437 | break; | ||
438 | |||
439 | case STEP_NEXT: | ||
440 | + case STEP_NEXT_CYCLE: | ||
441 | flag = GTK_PACK_START; | ||
442 | break; | ||
443 | } | ||
444 | @@ -2827,6 +2965,37 @@ | ||
445 | old_list = list; | ||
446 | list = list->prev; | ||
447 | } | ||
448 | + | ||
449 | + /* Hildon hack: keyboard navigation should cycle around */ | ||
450 | + if (direction == STEP_PREV_CYCLE) | ||
451 | + { | ||
452 | + /* find and return the last (visible) page */ | ||
453 | + list = g_list_last (notebook->children); | ||
454 | + if (!find_visible) | ||
455 | + return list; | ||
456 | + while (list) | ||
457 | + { | ||
458 | + page = list->data; | ||
459 | + if (GTK_WIDGET_VISIBLE (page->child)) | ||
460 | + return list; | ||
461 | + list = list->prev; | ||
462 | + } | ||
463 | + } | ||
464 | + if (direction == STEP_NEXT_CYCLE) | ||
465 | + { | ||
466 | + /* find and return the first (visible) page */ | ||
467 | + list = g_list_first (notebook->children); | ||
468 | + if (!find_visible) | ||
469 | + return list; | ||
470 | + while (list) | ||
471 | + { | ||
472 | + page = list->data; | ||
473 | + if (GTK_WIDGET_VISIBLE (page->child)) | ||
474 | + return list; | ||
475 | + list = list->next; | ||
476 | + } | ||
477 | + } | ||
478 | + | ||
479 | return NULL; | ||
480 | } | ||
481 | |||
482 | @@ -2850,6 +3019,7 @@ | ||
483 | gint gap_x = 0, gap_width = 0, step = STEP_PREV; | ||
484 | gboolean is_rtl; | ||
485 | gint tab_pos; | ||
486 | + gboolean paint_box_gap = FALSE; | ||
487 | |||
488 | g_return_if_fail (GTK_IS_NOTEBOOK (widget)); | ||
489 | g_return_if_fail (area != NULL); | ||
490 | @@ -2933,15 +3103,37 @@ | ||
491 | step = STEP_PREV; | ||
492 | break; | ||
493 | } | ||
494 | - gtk_paint_box_gap (widget->style, widget->window, | ||
495 | - GTK_STATE_NORMAL, GTK_SHADOW_OUT, | ||
496 | - area, widget, "notebook", | ||
497 | - x, y, width, height, | ||
498 | - tab_pos, gap_x, gap_width); | ||
499 | + | ||
500 | + /* hildon hack to postpone painting until it | ||
501 | + is known if scroll arrows will be drawn */ | ||
502 | + paint_box_gap = TRUE; | ||
503 | } | ||
504 | |||
505 | + /* first, figure out if arrows should be drawn */ | ||
506 | showarrow = FALSE; | ||
507 | children = gtk_notebook_search_page (notebook, NULL, step, TRUE); | ||
508 | + while (children && !showarrow) | ||
509 | + { | ||
510 | + page = children->data; | ||
511 | + children = gtk_notebook_search_page (notebook, children, | ||
512 | + step, TRUE); | ||
513 | + if (!GTK_WIDGET_MAPPED (page->tab_label)) | ||
514 | + showarrow = TRUE; | ||
515 | + } | ||
516 | + | ||
517 | + /* then draw content area frame */ | ||
518 | + if (paint_box_gap) | ||
519 | + gtk_paint_box_gap (widget->style, widget->window, | ||
520 | + GTK_STATE_NORMAL, GTK_SHADOW_OUT, | ||
521 | + area, widget, | ||
522 | + (showarrow && notebook->scrollable) | ||
523 | + ? "notebook_show_arrow" | ||
524 | + : "notebook", | ||
525 | + x, y, width, height, | ||
526 | + tab_pos, gap_x, gap_width); | ||
527 | + | ||
528 | + /* and finally draw tabs */ | ||
529 | + children = gtk_notebook_search_page (notebook, NULL, step, TRUE); | ||
530 | while (children) | ||
531 | { | ||
532 | page = children->data; | ||
533 | @@ -3069,10 +3261,15 @@ | ||
534 | GdkRectangle arrow_rect; | ||
535 | GtkArrowType arrow; | ||
536 | gboolean is_rtl, left; | ||
537 | + gint arrow_width, arrow_height; | ||
538 | |||
539 | gtk_notebook_get_arrow_rect (notebook, &arrow_rect, nbarrow); | ||
540 | |||
541 | widget = GTK_WIDGET (notebook); | ||
542 | + gtk_widget_style_get (widget, | ||
543 | + "arrow-width", &arrow_width, | ||
544 | + "arrow-height", &arrow_height, | ||
545 | + NULL); | ||
546 | |||
547 | is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL; | ||
548 | left = (ARROW_IS_LEFT (nbarrow) && !is_rtl) || | ||
549 | @@ -3112,7 +3309,7 @@ | ||
550 | gtk_paint_arrow (widget->style, widget->window, state_type, | ||
551 | shadow_type, NULL, widget, "notebook", | ||
552 | arrow, TRUE, arrow_rect.x, arrow_rect.y, | ||
553 | - ARROW_SIZE, ARROW_SIZE); | ||
554 | + arrow_width, arrow_height); | ||
555 | } | ||
556 | } | ||
557 | |||
558 | @@ -3143,13 +3340,25 @@ | ||
559 | gboolean is_rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL && | ||
560 | (tab_pos == GTK_POS_TOP || tab_pos == GTK_POS_BOTTOM)); | ||
561 | gint memo_x; | ||
562 | + gboolean truncate = FALSE; | ||
563 | + gint arrow_width, arrow_height, arrow_spacing, tab_overlap; | ||
564 | + gint total_width, ideal_tab_width, n_expanding_tabs; | ||
565 | |||
566 | if (!notebook->show_tabs || !notebook->children || !notebook->cur_page) | ||
567 | return; | ||
568 | |||
569 | + gtk_widget_style_get (widget, | ||
570 | + "arrow-width", &arrow_width, | ||
571 | + "arrow-height", &arrow_height, | ||
572 | + "arrow-spacing", &arrow_spacing, | ||
573 | + "tab-overlap", &tab_overlap, | ||
574 | + NULL); | ||
575 | + | ||
576 | child_allocation.x = widget->allocation.x + container->border_width; | ||
577 | child_allocation.y = widget->allocation.y + container->border_width; | ||
578 | |||
579 | + total_width = allocation->width - 2 * container->border_width - tab_overlap; | ||
580 | + | ||
581 | switch (tab_pos) | ||
582 | { | ||
583 | case GTK_POS_BOTTOM: | ||
584 | @@ -3198,27 +3407,26 @@ | ||
585 | if (GTK_WIDGET_VISIBLE (page->child)) | ||
586 | tab_space += page->requisition.width; | ||
587 | } | ||
588 | - if (tab_space > | ||
589 | - allocation->width - 2 * container->border_width - TAB_OVERLAP) | ||
590 | + if (tab_space > total_width) | ||
591 | { | ||
592 | showarrow = TRUE; | ||
593 | page = focus_tab->data; | ||
594 | |||
595 | - tab_space = allocation->width - TAB_OVERLAP - | ||
596 | + tab_space = allocation->width - tab_overlap - | ||
597 | page->requisition.width - 2 * container->border_width; | ||
598 | if (notebook->has_after_previous) | ||
599 | - tab_space -= ARROW_SPACING + ARROW_SIZE; | ||
600 | + tab_space -= arrow_spacing + arrow_width; | ||
601 | if (notebook->has_after_next) | ||
602 | - tab_space -= ARROW_SPACING + ARROW_SIZE; | ||
603 | + tab_space -= arrow_spacing + arrow_width; | ||
604 | if (notebook->has_before_previous) | ||
605 | { | ||
606 | - tab_space -= ARROW_SPACING + ARROW_SIZE; | ||
607 | - child_allocation.x += ARROW_SPACING + ARROW_SIZE; | ||
608 | + tab_space -= arrow_spacing + arrow_width; | ||
609 | + child_allocation.x += arrow_spacing + arrow_width; | ||
610 | } | ||
611 | if (notebook->has_before_next) | ||
612 | { | ||
613 | - tab_space -= ARROW_SPACING + ARROW_SIZE; | ||
614 | - child_allocation.x += ARROW_SPACING + ARROW_SIZE; | ||
615 | + tab_space -= arrow_spacing + arrow_width; | ||
616 | + child_allocation.x += arrow_spacing + arrow_width; | ||
617 | } | ||
618 | } | ||
619 | break; | ||
620 | @@ -3233,19 +3441,19 @@ | ||
621 | tab_space += page->requisition.height; | ||
622 | } | ||
623 | if (tab_space > | ||
624 | - (allocation->height - 2 * container->border_width - TAB_OVERLAP)) | ||
625 | + (allocation->height - 2 * container->border_width - tab_overlap)) | ||
626 | { | ||
627 | showarrow = TRUE; | ||
628 | page = focus_tab->data; | ||
629 | tab_space = allocation->height | ||
630 | - - TAB_OVERLAP - 2 * container->border_width | ||
631 | + - tab_overlap - 2 * container->border_width | ||
632 | - page->requisition.height; | ||
633 | if (notebook->has_after_previous || notebook->has_after_next) | ||
634 | - tab_space -= ARROW_SPACING + ARROW_SIZE; | ||
635 | + tab_space -= arrow_spacing + arrow_height; | ||
636 | if (notebook->has_before_previous || notebook->has_before_next) | ||
637 | { | ||
638 | - tab_space -= ARROW_SPACING + ARROW_SIZE; | ||
639 | - child_allocation.y += ARROW_SPACING + ARROW_SIZE; | ||
640 | + tab_space -= arrow_spacing + arrow_height; | ||
641 | + child_allocation.y += arrow_spacing + arrow_height; | ||
642 | } | ||
643 | } | ||
644 | break; | ||
645 | @@ -3257,6 +3465,10 @@ | ||
646 | notebook->first_tab = focus_tab; | ||
647 | last_child = gtk_notebook_search_page (notebook, focus_tab, | ||
648 | STEP_NEXT, TRUE); | ||
649 | + | ||
650 | + /* Hildon: there is only one visible tab label | ||
651 | + and it doesn't fit unless it is truncated */ | ||
652 | + truncate = TRUE; | ||
653 | } | ||
654 | else | ||
655 | { | ||
656 | @@ -3413,7 +3625,7 @@ | ||
657 | } | ||
658 | tab_space -= allocation->height; | ||
659 | } | ||
660 | - tab_space += 2 * container->border_width + TAB_OVERLAP; | ||
661 | + tab_space += 2 * container->border_width + tab_overlap; | ||
662 | tab_space *= -1; | ||
663 | notebook->first_tab = gtk_notebook_search_page (notebook, NULL, | ||
664 | STEP_NEXT, TRUE); | ||
665 | @@ -3432,12 +3644,29 @@ | ||
666 | if (showarrow) | ||
667 | { | ||
668 | if (notebook->has_after_previous) | ||
669 | - child_allocation.x -= ARROW_SPACING + ARROW_SIZE; | ||
670 | + child_allocation.x -= arrow_spacing + arrow_width; | ||
671 | if (notebook->has_after_next) | ||
672 | - child_allocation.x -= ARROW_SPACING + ARROW_SIZE; | ||
673 | + child_allocation.x -= arrow_spacing + arrow_width; | ||
674 | } | ||
675 | } | ||
676 | |||
677 | + ideal_tab_width = (total_width / n); | ||
678 | + n_expanding_tabs = 0; | ||
679 | + | ||
680 | + while (children) | ||
681 | + { | ||
682 | + if (children == last_child) | ||
683 | + break; | ||
684 | + | ||
685 | + page = children->data; | ||
686 | + children = gtk_notebook_search_page (notebook, children, STEP_NEXT,TRUE); | ||
687 | + | ||
688 | + if (page->requisition.width <= ideal_tab_width) | ||
689 | + n_expanding_tabs++; | ||
690 | + } | ||
691 | + | ||
692 | + children = notebook->first_tab; | ||
693 | + | ||
694 | while (children) | ||
695 | { | ||
696 | if (children == last_child) | ||
697 | @@ -3452,9 +3681,11 @@ | ||
698 | children = gtk_notebook_search_page (notebook, children, STEP_NEXT,TRUE); | ||
699 | |||
700 | delta = 0; | ||
701 | - if (n && (showarrow || page->expand || notebook->homogeneous)) | ||
702 | + | ||
703 | + if (n && (showarrow || page->expand || notebook->homogeneous) && | ||
704 | + (page->requisition.width <= ideal_tab_width)) | ||
705 | { | ||
706 | - new_fill = (tab_space * i++) / n; | ||
707 | + new_fill = (tab_space * i++) / n_expanding_tabs; | ||
708 | delta = new_fill - old_fill; | ||
709 | old_fill = new_fill; | ||
710 | } | ||
711 | @@ -3463,15 +3694,18 @@ | ||
712 | { | ||
713 | case GTK_POS_TOP: | ||
714 | case GTK_POS_BOTTOM: | ||
715 | + if (truncate) | ||
716 | + delta *= -1; | ||
717 | + | ||
718 | child_allocation.width = (page->requisition.width + | ||
719 | - TAB_OVERLAP + delta); | ||
720 | + tab_overlap + delta); | ||
721 | if (is_rtl) | ||
722 | child_allocation.x -= child_allocation.width; | ||
723 | break; | ||
724 | case GTK_POS_LEFT: | ||
725 | case GTK_POS_RIGHT: | ||
726 | child_allocation.height = (page->requisition.height + | ||
727 | - TAB_OVERLAP + delta); | ||
728 | + tab_overlap + delta); | ||
729 | break; | ||
730 | } | ||
731 | |||
732 | @@ -3482,13 +3716,13 @@ | ||
733 | case GTK_POS_TOP: | ||
734 | case GTK_POS_BOTTOM: | ||
735 | if (!is_rtl) | ||
736 | - child_allocation.x += child_allocation.width - TAB_OVERLAP; | ||
737 | + child_allocation.x += child_allocation.width - tab_overlap; | ||
738 | else | ||
739 | - child_allocation.x += TAB_OVERLAP; | ||
740 | + child_allocation.x += tab_overlap; | ||
741 | break; | ||
742 | case GTK_POS_LEFT: | ||
743 | case GTK_POS_RIGHT: | ||
744 | - child_allocation.y += child_allocation.height - TAB_OVERLAP; | ||
745 | + child_allocation.y += child_allocation.height - tab_overlap; | ||
746 | break; | ||
747 | } | ||
748 | |||
749 | @@ -3538,14 +3772,14 @@ | ||
750 | case GTK_POS_TOP: | ||
751 | case GTK_POS_BOTTOM: | ||
752 | child_allocation.width = (page->requisition.width + | ||
753 | - TAB_OVERLAP + delta); | ||
754 | + tab_overlap + delta); | ||
755 | if (!is_rtl) | ||
756 | child_allocation.x -= child_allocation.width; | ||
757 | break; | ||
758 | case GTK_POS_LEFT: | ||
759 | case GTK_POS_RIGHT: | ||
760 | child_allocation.height = (page->requisition.height + | ||
761 | - TAB_OVERLAP + delta); | ||
762 | + tab_overlap + delta); | ||
763 | child_allocation.y -= child_allocation.height; | ||
764 | break; | ||
765 | } | ||
766 | @@ -3557,13 +3791,13 @@ | ||
767 | case GTK_POS_TOP: | ||
768 | case GTK_POS_BOTTOM: | ||
769 | if (!is_rtl) | ||
770 | - child_allocation.x += TAB_OVERLAP; | ||
771 | + child_allocation.x += tab_overlap; | ||
772 | else | ||
773 | - child_allocation.x += child_allocation.width - TAB_OVERLAP; | ||
774 | + child_allocation.x += child_allocation.width - tab_overlap; | ||
775 | break; | ||
776 | case GTK_POS_LEFT: | ||
777 | case GTK_POS_RIGHT: | ||
778 | - child_allocation.y += TAB_OVERLAP; | ||
779 | + child_allocation.y += tab_overlap; | ||
780 | break; | ||
781 | } | ||
782 | |||
783 | @@ -3589,8 +3823,12 @@ | ||
784 | gint padding; | ||
785 | gint focus_width; | ||
786 | gint tab_pos = get_effective_tab_pos (notebook); | ||
787 | + gint tab_curvature; | ||
788 | |||
789 | - gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL); | ||
790 | + gtk_widget_style_get (widget, | ||
791 | + "focus-line-width", &focus_width, | ||
792 | + "tab-curvature", &tab_curvature, | ||
793 | + NULL); | ||
794 | |||
795 | xthickness = widget->style->xthickness; | ||
796 | ythickness = widget->style->ythickness; | ||
797 | @@ -3621,7 +3859,7 @@ | ||
798 | { | ||
799 | case GTK_POS_TOP: | ||
800 | case GTK_POS_BOTTOM: | ||
801 | - padding = TAB_CURVATURE + focus_width + notebook->tab_hborder; | ||
802 | + padding = tab_curvature + focus_width + notebook->tab_hborder; | ||
803 | if (page->fill) | ||
804 | { | ||
805 | child_allocation.x = (xthickness + focus_width + | ||
806 | @@ -3646,7 +3884,7 @@ | ||
807 | break; | ||
808 | case GTK_POS_LEFT: | ||
809 | case GTK_POS_RIGHT: | ||
810 | - padding = TAB_CURVATURE + focus_width + notebook->tab_vborder; | ||
811 | + padding = tab_curvature + focus_width + notebook->tab_vborder; | ||
812 | if (page->fill) | ||
813 | { | ||
814 | child_allocation.y = ythickness + padding; | ||
815 | @@ -4340,7 +4578,7 @@ | ||
816 | } | ||
817 | page->tab_label = tab_label; | ||
818 | page->menu_label = menu_label; | ||
819 | - page->expand = FALSE; | ||
820 | + page->expand = TRUE; | ||
821 | page->fill = TRUE; | ||
822 | page->pack = GTK_PACK_START; | ||
823 | |||
824 | @@ -5046,6 +5284,7 @@ | ||
825 | { | ||
826 | page->default_tab = FALSE; | ||
827 | page->tab_label = tab_label; | ||
828 | + | ||
829 | gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook)); | ||
830 | } | ||
831 | else | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkprogress.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkprogress.c.diff deleted file mode 100644 index 07302bbab8..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkprogress.c.diff +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkprogress.c 2004-10-28 18:00:04.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkprogress.c 2005-04-06 16:19:37.066903336 +0300 | ||
3 | @@ -371,6 +371,17 @@ | ||
4 | widget->allocation.width, | ||
5 | widget->allocation.height, | ||
6 | -1); | ||
7 | + | ||
8 | + /* OSSO addition : clear the pixmap first or transparent images | ||
9 | + * painted on top of it may look stupid when it's blended against | ||
10 | + * random memory.*/ | ||
11 | + gtk_paint_flat_box (widget->style, | ||
12 | + progress->offscreen_pixmap, | ||
13 | + GTK_STATE_NORMAL, | ||
14 | + GTK_SHADOW_NONE, | ||
15 | + NULL, widget, NULL, | ||
16 | + 0, 0, widget->allocation.width, widget->allocation.height); | ||
17 | + | ||
18 | GTK_PROGRESS_GET_CLASS (progress)->paint (progress); | ||
19 | } | ||
20 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkprogressbar.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkprogressbar.c.diff deleted file mode 100644 index 097e348c41..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkprogressbar.c.diff +++ /dev/null | |||
@@ -1,141 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkprogressbar.c 2005-01-09 19:32:25.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkprogressbar.c 2005-04-06 16:19:37.112896344 +0300 | ||
3 | @@ -40,11 +40,18 @@ | ||
4 | |||
5 | |||
6 | #define MIN_HORIZONTAL_BAR_WIDTH 150 | ||
7 | -#define MIN_HORIZONTAL_BAR_HEIGHT 20 | ||
8 | +#define MIN_HORIZONTAL_BAR_HEIGHT 30 /* OSSO mod. was 20 */ | ||
9 | #define MIN_VERTICAL_BAR_WIDTH 22 | ||
10 | #define MIN_VERTICAL_BAR_HEIGHT 80 | ||
11 | #define MAX_TEXT_LENGTH 80 | ||
12 | -#define TEXT_SPACING 2 | ||
13 | +#define DEFAULT_TEXT_SPACING 2 /* OSSO mod. Changed from | ||
14 | + * TEXT_SPACING. Now controlled | ||
15 | + * by "text-spacing" style | ||
16 | + * property */ | ||
17 | +#define DEFAULT_WIDTH_INCREMENT 3 | ||
18 | +#define DEFAULT_HEIGHT_INCREMENT 3 | ||
19 | +#define DEFAULT_TEXT_XNUDGE 1 | ||
20 | +#define DEFAULT_TEXT_YNUDGE 1 | ||
21 | |||
22 | enum { | ||
23 | PROP_0, | ||
24 | @@ -245,6 +252,51 @@ | ||
25 | PANGO_ELLIPSIZE_NONE, | ||
26 | G_PARAM_READWRITE)); | ||
27 | |||
28 | + /* OSSO addition. */ | ||
29 | + gtk_widget_class_install_style_property (widget_class, | ||
30 | + g_param_spec_int ("text-spacing", | ||
31 | + "Text Spacing", | ||
32 | + "The amount of pixels between the trough and text.", | ||
33 | + G_MININT, | ||
34 | + G_MAXINT, | ||
35 | + DEFAULT_TEXT_SPACING, | ||
36 | + G_PARAM_READWRITE)); | ||
37 | + | ||
38 | + gtk_widget_class_install_style_property (widget_class, | ||
39 | + g_param_spec_int ("width-increment", | ||
40 | + "width Increment", | ||
41 | + "The amount of pixels to add to the width size request.", | ||
42 | + G_MININT, | ||
43 | + G_MAXINT, | ||
44 | + DEFAULT_WIDTH_INCREMENT, | ||
45 | + G_PARAM_READWRITE)); | ||
46 | + | ||
47 | + gtk_widget_class_install_style_property (widget_class, | ||
48 | + g_param_spec_int ("height-increment", | ||
49 | + "Height Increment", | ||
50 | + "The amount of pixels to add to the height size request.", | ||
51 | + G_MININT, | ||
52 | + G_MAXINT, | ||
53 | + DEFAULT_WIDTH_INCREMENT, | ||
54 | + G_PARAM_READWRITE)); | ||
55 | + | ||
56 | + gtk_widget_class_install_style_property (widget_class, | ||
57 | + g_param_spec_int ("text-xnudge", | ||
58 | + "Text XNudge", | ||
59 | + "Amount of pixels to move the text x position.", | ||
60 | + G_MININT, | ||
61 | + G_MAXINT, | ||
62 | + DEFAULT_TEXT_XNUDGE, | ||
63 | + G_PARAM_READWRITE)); | ||
64 | + | ||
65 | + gtk_widget_class_install_style_property (widget_class, | ||
66 | + g_param_spec_int ("text-ynudge", | ||
67 | + "Text YNudge", | ||
68 | + "Amount of pixels to move the text y position.", | ||
69 | + G_MININT, | ||
70 | + G_MAXINT, | ||
71 | + DEFAULT_TEXT_YNUDGE, | ||
72 | + G_PARAM_READWRITE)); | ||
73 | } | ||
74 | |||
75 | static void | ||
76 | @@ -364,7 +416,9 @@ | ||
77 | { | ||
78 | GtkWidget *pbar; | ||
79 | |||
80 | - pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR, NULL); | ||
81 | + pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR, | ||
82 | + "text-xalign", 0.0, /* OSSO addition. */ | ||
83 | + NULL); | ||
84 | |||
85 | return pbar; | ||
86 | } | ||
87 | @@ -494,15 +548,23 @@ | ||
88 | PangoRectangle logical_rect; | ||
89 | PangoLayout *layout; | ||
90 | gint width, height; | ||
91 | + gint text_spacing; | ||
92 | + gint width_increment, height_increment; | ||
93 | |||
94 | g_return_if_fail (GTK_IS_PROGRESS_BAR (widget)); | ||
95 | g_return_if_fail (requisition != NULL); | ||
96 | + | ||
97 | + gtk_widget_style_get (widget, | ||
98 | + "text-spacing", &text_spacing, | ||
99 | + "width-increment", &width_increment, | ||
100 | + "height-increment", &height_increment, | ||
101 | + NULL); | ||
102 | |||
103 | progress = GTK_PROGRESS (widget); | ||
104 | pbar = GTK_PROGRESS_BAR (widget); | ||
105 | |||
106 | - width = 2 * widget->style->xthickness + 3 + 2 * TEXT_SPACING; | ||
107 | - height = 2 * widget->style->ythickness + 3 + 2 * TEXT_SPACING; | ||
108 | + width = 2 * widget->style->xthickness + width_increment + 2 * text_spacing; | ||
109 | + height = 2 * widget->style->ythickness + height_increment + 2 * text_spacing; | ||
110 | |||
111 | if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE) | ||
112 | { | ||
113 | @@ -780,6 +842,13 @@ | ||
114 | PangoRectangle logical_rect; | ||
115 | GdkRectangle prelight_clip, normal_clip; | ||
116 | |||
117 | + gint text_xnudge, text_ynudge; | ||
118 | + | ||
119 | + gtk_widget_style_get (widget, | ||
120 | + "text-xnudge", &text_xnudge, | ||
121 | + "text-ynudge", &text_ynudge, | ||
122 | + NULL); | ||
123 | + | ||
124 | buf = gtk_progress_get_current_text (progress); | ||
125 | |||
126 | layout = gtk_widget_create_pango_layout (widget, buf); | ||
127 | @@ -789,12 +858,12 @@ | ||
128 | |||
129 | pango_layout_get_pixel_extents (layout, NULL, &logical_rect); | ||
130 | |||
131 | - x = widget->style->xthickness + 1 + | ||
132 | + x = widget->style->xthickness + text_xnudge + | ||
133 | (widget->allocation.width - 2 * widget->style->xthickness - | ||
134 | 2 - logical_rect.width) | ||
135 | * progress->x_align; | ||
136 | |||
137 | - y = widget->style->ythickness + 1 + | ||
138 | + y = widget->style->ythickness + text_ynudge + | ||
139 | (widget->allocation.height - 2 * widget->style->ythickness - | ||
140 | 2 - logical_rect.height) | ||
141 | * progress->y_align; | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkradiobutton.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkradiobutton.c.diff deleted file mode 100644 index f4669c6d9f..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkradiobutton.c.diff +++ /dev/null | |||
@@ -1,244 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkradiobutton.c 2004-08-09 19:59:52.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkradiobutton.c 2005-04-06 16:19:37.126894216 +0300 | ||
3 | @@ -31,6 +31,7 @@ | ||
4 | #include "gtkradiobutton.h" | ||
5 | #include "gtkintl.h" | ||
6 | |||
7 | +#define TOGGLE_ON_CLICK "toggle-on-click" | ||
8 | |||
9 | enum { | ||
10 | PROP_0, | ||
11 | @@ -506,6 +507,9 @@ | ||
12 | { | ||
13 | tmp_list = tmp_list->next; | ||
14 | |||
15 | + if( !tmp_list ) | ||
16 | + return FALSE; | ||
17 | + | ||
18 | while (tmp_list) | ||
19 | { | ||
20 | GtkWidget *child = tmp_list->data; | ||
21 | @@ -543,7 +547,10 @@ | ||
22 | if (new_focus) | ||
23 | { | ||
24 | gtk_widget_grab_focus (new_focus); | ||
25 | - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE); | ||
26 | + | ||
27 | + /* arrow keys select the button ? CHECK THIS!! | ||
28 | + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE); | ||
29 | + */ | ||
30 | } | ||
31 | |||
32 | return TRUE; | ||
33 | @@ -579,7 +586,7 @@ | ||
34 | GtkToggleButton *toggle_button; | ||
35 | GtkRadioButton *radio_button; | ||
36 | GtkToggleButton *tmp_button; | ||
37 | - GtkStateType new_state; | ||
38 | + GtkStateType new_state = GTK_WIDGET_STATE( button ); | ||
39 | GSList *tmp_list; | ||
40 | gint toggled; | ||
41 | gboolean depressed; | ||
42 | @@ -591,52 +598,54 @@ | ||
43 | g_object_ref (GTK_WIDGET (button)); | ||
44 | |||
45 | if (toggle_button->active) | ||
46 | - { | ||
47 | - tmp_button = NULL; | ||
48 | - tmp_list = radio_button->group; | ||
49 | - | ||
50 | - while (tmp_list) | ||
51 | - { | ||
52 | - tmp_button = tmp_list->data; | ||
53 | - tmp_list = tmp_list->next; | ||
54 | + { | ||
55 | + tmp_button = NULL; | ||
56 | + tmp_list = radio_button->group; | ||
57 | |||
58 | - if (tmp_button->active && tmp_button != toggle_button) | ||
59 | - break; | ||
60 | + while (tmp_list) | ||
61 | + { | ||
62 | + tmp_button = tmp_list->data; | ||
63 | + tmp_list = tmp_list->next; | ||
64 | + | ||
65 | + if (tmp_button->active && tmp_button != toggle_button) | ||
66 | + break; | ||
67 | |||
68 | - tmp_button = NULL; | ||
69 | - } | ||
70 | + tmp_button = NULL; | ||
71 | + } | ||
72 | |||
73 | - if (!tmp_button) | ||
74 | - { | ||
75 | - new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE); | ||
76 | + if (!tmp_button) | ||
77 | + { | ||
78 | + new_state = (button->in_button ? | ||
79 | + GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE); | ||
80 | + } | ||
81 | + else | ||
82 | + { | ||
83 | + toggled = TRUE; | ||
84 | + toggle_button->active = !toggle_button->active; | ||
85 | + new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL); | ||
86 | + } | ||
87 | } | ||
88 | else | ||
89 | { | ||
90 | toggled = TRUE; | ||
91 | toggle_button->active = !toggle_button->active; | ||
92 | - new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL); | ||
93 | - } | ||
94 | - } | ||
95 | - else | ||
96 | - { | ||
97 | - toggled = TRUE; | ||
98 | - toggle_button->active = !toggle_button->active; | ||
99 | |||
100 | - tmp_list = radio_button->group; | ||
101 | - while (tmp_list) | ||
102 | - { | ||
103 | - tmp_button = tmp_list->data; | ||
104 | - tmp_list = tmp_list->next; | ||
105 | - | ||
106 | - if (tmp_button->active && (tmp_button != toggle_button)) | ||
107 | + tmp_list = radio_button->group; | ||
108 | + while (tmp_list) | ||
109 | { | ||
110 | - gtk_button_clicked (GTK_BUTTON (tmp_button)); | ||
111 | - break; | ||
112 | + tmp_button = tmp_list->data; | ||
113 | + tmp_list = tmp_list->next; | ||
114 | + | ||
115 | + if (tmp_button->active && (tmp_button != toggle_button)) | ||
116 | + { | ||
117 | + gtk_button_clicked (GTK_BUTTON (tmp_button)); | ||
118 | + break; | ||
119 | + } | ||
120 | } | ||
121 | + | ||
122 | + new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE); | ||
123 | } | ||
124 | |||
125 | - new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE); | ||
126 | - } | ||
127 | |||
128 | if (toggle_button->inconsistent) | ||
129 | depressed = FALSE; | ||
130 | @@ -663,7 +672,6 @@ | ||
131 | GdkRectangle *area) | ||
132 | { | ||
133 | GtkWidget *widget; | ||
134 | - GtkWidget *child; | ||
135 | GtkButton *button; | ||
136 | GtkToggleButton *toggle_button; | ||
137 | GtkStateType state_type; | ||
138 | @@ -686,54 +694,80 @@ | ||
139 | "focus-padding", &focus_pad, | ||
140 | NULL); | ||
141 | |||
142 | - _gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing); | ||
143 | - | ||
144 | - x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width; | ||
145 | - y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2; | ||
146 | - | ||
147 | - child = GTK_BIN (check_button)->child; | ||
148 | - if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child))) | ||
149 | - x += focus_width + focus_pad; | ||
150 | + _gtk_check_button_get_props (check_button, | ||
151 | + &indicator_size, &indicator_spacing); | ||
152 | |||
153 | + x = widget->allocation.x + indicator_spacing + | ||
154 | + GTK_CONTAINER (widget)->border_width; | ||
155 | + y = widget->allocation.y + (widget->allocation.height - | ||
156 | + indicator_size + focus_width + | ||
157 | + focus_pad) / 2; | ||
158 | + | ||
159 | + /* Hildon - always add space for the padding | ||
160 | + */ | ||
161 | + x += focus_width + focus_pad; | ||
162 | + | ||
163 | if (toggle_button->inconsistent) | ||
164 | - shadow_type = GTK_SHADOW_ETCHED_IN; | ||
165 | + shadow_type = GTK_SHADOW_ETCHED_IN; | ||
166 | + | ||
167 | else if (toggle_button->active) | ||
168 | - shadow_type = GTK_SHADOW_IN; | ||
169 | + shadow_type = GTK_SHADOW_IN; | ||
170 | + | ||
171 | else | ||
172 | - shadow_type = GTK_SHADOW_OUT; | ||
173 | + shadow_type = GTK_SHADOW_OUT; | ||
174 | + | ||
175 | + if (button->activate_timeout || | ||
176 | + (button->button_down && button->in_button) ) | ||
177 | + state_type = GTK_STATE_ACTIVE; | ||
178 | |||
179 | - if (button->activate_timeout || (button->button_down && button->in_button)) | ||
180 | - state_type = GTK_STATE_ACTIVE; | ||
181 | else if (button->in_button) | ||
182 | - state_type = GTK_STATE_PRELIGHT; | ||
183 | + state_type = GTK_STATE_PRELIGHT; | ||
184 | + | ||
185 | else if (!GTK_WIDGET_IS_SENSITIVE (widget)) | ||
186 | state_type = GTK_STATE_INSENSITIVE; | ||
187 | + | ||
188 | else | ||
189 | - state_type = GTK_STATE_NORMAL; | ||
190 | + state_type = GTK_STATE_NORMAL; | ||
191 | |||
192 | + /* Hildon change. We want to draw active image always when we have | ||
193 | + * focus. */ | ||
194 | + if (GTK_WIDGET_HAS_FOCUS (widget)) | ||
195 | + state_type = GTK_STATE_ACTIVE; | ||
196 | + | ||
197 | if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
198 | - x = widget->allocation.x + widget->allocation.width - (indicator_size + x - widget->allocation.x); | ||
199 | - | ||
200 | + { | ||
201 | + x = widget->allocation.x + widget->allocation.width - | ||
202 | + (indicator_size + x - widget->allocation.x); | ||
203 | + } | ||
204 | + /* Well, commenting this out fixes bug #280, | ||
205 | + without apparent side effects. | ||
206 | + * | ||
207 | if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_PRELIGHT) | ||
208 | { | ||
209 | GdkRectangle restrict_area; | ||
210 | GdkRectangle new_area; | ||
211 | |||
212 | - restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width; | ||
213 | - restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width; | ||
214 | - restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width); | ||
215 | - restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width); | ||
216 | + restrict_area.x = widget->allocation.x + | ||
217 | + GTK_CONTAINER (widget)->border_width; | ||
218 | + restrict_area.y = widget->allocation.y + | ||
219 | + GTK_CONTAINER (widget)->border_width; | ||
220 | + restrict_area.width = widget->allocation.width - | ||
221 | + (2 * GTK_CONTAINER (widget)->border_width); | ||
222 | + restrict_area.height = widget->allocation.height - | ||
223 | + (2 * GTK_CONTAINER (widget)->border_width); | ||
224 | |||
225 | if (gdk_rectangle_intersect (area, &restrict_area, &new_area)) | ||
226 | { | ||
227 | - gtk_paint_flat_box (widget->style, widget->window, GTK_STATE_PRELIGHT, | ||
228 | - GTK_SHADOW_ETCHED_OUT, | ||
229 | - area, widget, "checkbutton", | ||
230 | - new_area.x, new_area.y, | ||
231 | - new_area.width, new_area.height); | ||
232 | + gtk_paint_flat_box (widget->style, widget->window, | ||
233 | + GTK_STATE_PRELIGHT, | ||
234 | + GTK_SHADOW_ETCHED_OUT, | ||
235 | + area, widget, "checkbutton", | ||
236 | + new_area.x, new_area.y, | ||
237 | + new_area.width, new_area.height); | ||
238 | } | ||
239 | } | ||
240 | |||
241 | + */ | ||
242 | gtk_paint_option (widget->style, widget->window, | ||
243 | state_type, shadow_type, | ||
244 | area, widget, "radiobutton", | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrange.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrange.c.diff deleted file mode 100644 index 867d2b1d46..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrange.c.diff +++ /dev/null | |||
@@ -1,845 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkrange.c 2004-11-10 05:20:11.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkrange.c 2005-04-06 16:19:37.788793592 +0300 | ||
3 | @@ -25,6 +25,10 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | #include <config.h> | ||
12 | #include <stdio.h> | ||
13 | #include <math.h> | ||
14 | @@ -44,7 +48,10 @@ | ||
15 | PROP_0, | ||
16 | PROP_UPDATE_POLICY, | ||
17 | PROP_ADJUSTMENT, | ||
18 | - PROP_INVERTED | ||
19 | + PROP_INVERTED, | ||
20 | + PROP_STREAM_INDICATOR, | ||
21 | + PROP_MINIMUM_VISIBLE_BARS, | ||
22 | + PROP_STREAM_POSITION | ||
23 | }; | ||
24 | |||
25 | enum { | ||
26 | @@ -88,8 +95,20 @@ | ||
27 | /* "grabbed" mouse location, OUTSIDE for no grab */ | ||
28 | MouseLocation grab_location; | ||
29 | gint grab_button; /* 0 if none */ | ||
30 | + | ||
31 | + /* OSSO hack: stream trough split position */ | ||
32 | + gint stream_pixel_position; | ||
33 | + gint minimum_visible_bars; | ||
34 | }; | ||
35 | |||
36 | +#define OSSO_GTK_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_RANGE, OssoGtkRangePrivate)) | ||
37 | +typedef struct _OssoGtkRangePrivate OssoGtkRangePrivate; | ||
38 | + | ||
39 | +struct _OssoGtkRangePrivate | ||
40 | +{ | ||
41 | + gboolean stream_indicator; | ||
42 | + gdouble stream_position; | ||
43 | +}; | ||
44 | |||
45 | static void gtk_range_class_init (GtkRangeClass *klass); | ||
46 | static void gtk_range_init (GtkRange *range); | ||
47 | @@ -135,6 +154,7 @@ | ||
48 | gint mouse_x, | ||
49 | gint mouse_y); | ||
50 | |||
51 | +static gint osso_gtk_range_focus_out (GtkWidget *widget, GdkEventFocus *event); | ||
52 | |||
53 | /* Range methods */ | ||
54 | |||
55 | @@ -247,6 +267,9 @@ | ||
56 | widget_class->state_changed = gtk_range_state_changed; | ||
57 | widget_class->style_set = gtk_range_style_set; | ||
58 | |||
59 | + /* OSSO addition (see bug #1653) */ | ||
60 | + widget_class->focus_out_event = osso_gtk_range_focus_out; | ||
61 | + | ||
62 | class->move_slider = gtk_range_move_slider; | ||
63 | class->change_value = gtk_range_real_change_value; | ||
64 | |||
65 | @@ -344,6 +367,34 @@ | ||
66 | FALSE, | ||
67 | G_PARAM_READWRITE)); | ||
68 | |||
69 | + g_object_class_install_property (gobject_class, | ||
70 | + PROP_STREAM_INDICATOR, | ||
71 | + g_param_spec_boolean ("stream_indicator", | ||
72 | + P_("Stream Indicator"), | ||
73 | + P_("Whether to display a stream indicator graphics on trough."), | ||
74 | + FALSE, | ||
75 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); | ||
76 | + | ||
77 | + g_object_class_install_property (gobject_class, | ||
78 | + PROP_MINIMUM_VISIBLE_BARS, | ||
79 | + g_param_spec_int ("minimum_visible_bars", | ||
80 | + P_("Minimum visible bars"), | ||
81 | + P_("The minimum number of visible bars in a HildonControlBar"), | ||
82 | + 0, | ||
83 | + G_MAXINT, | ||
84 | + 0, | ||
85 | + G_PARAM_READWRITE)); | ||
86 | + | ||
87 | + g_object_class_install_property (gobject_class, | ||
88 | + PROP_STREAM_POSITION, | ||
89 | + g_param_spec_double ("stream_position", | ||
90 | + P_("Stream Position"), | ||
91 | + P_("The position of the streaming."), | ||
92 | + -G_MAXDOUBLE, | ||
93 | + G_MAXDOUBLE, | ||
94 | + 0.0, | ||
95 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); | ||
96 | + | ||
97 | gtk_widget_class_install_style_property (widget_class, | ||
98 | g_param_spec_int ("slider_width", | ||
99 | P_("Slider Width"), | ||
100 | @@ -392,6 +443,52 @@ | ||
101 | G_MAXINT, | ||
102 | 0, | ||
103 | G_PARAM_READABLE)); | ||
104 | + | ||
105 | + gtk_widget_class_install_style_property (widget_class, | ||
106 | + g_param_spec_boolean ("hildonlike", | ||
107 | + _("hildonlike"), | ||
108 | + _("Change focus out behaviour, 1/0"), | ||
109 | + FALSE, | ||
110 | + G_PARAM_READABLE)); | ||
111 | + | ||
112 | + gtk_widget_class_install_style_property (widget_class, | ||
113 | + g_param_spec_boolean ("two_part_trough", | ||
114 | + _("Two-part trough"), | ||
115 | + _("Allow different trough graphics on different sides of the slider, 1/0"), | ||
116 | + FALSE, | ||
117 | + G_PARAM_READABLE)); | ||
118 | + | ||
119 | + gtk_widget_class_install_style_property (widget_class, | ||
120 | + g_param_spec_int ("stream_indicator_padding", | ||
121 | + P_("Stream Indicator Padding"), | ||
122 | + P_("How many pixels smallerthan the trough the stream indicator is drawn from both ends ."), | ||
123 | + 0, | ||
124 | + G_MAXINT, | ||
125 | + 1, | ||
126 | + G_PARAM_READABLE)); | ||
127 | + | ||
128 | + gtk_widget_class_install_style_property (widget_class, | ||
129 | + g_param_spec_boolean ("autodimmed_steppers", | ||
130 | + _("Autodimmed steppers"), | ||
131 | + _("Automatically dim steppers when maximum or minimum value has been reached"), | ||
132 | + FALSE, | ||
133 | + G_PARAM_READABLE)); | ||
134 | + | ||
135 | + gtk_widget_class_install_style_property (widget_class, | ||
136 | + g_param_spec_boolean ("arrow_paint_box_layout", | ||
137 | + _("Arrow paint box layout"), | ||
138 | + _("Allows to use images instead of normal arrows."), | ||
139 | + FALSE, | ||
140 | + G_PARAM_READABLE)); | ||
141 | + | ||
142 | + gtk_widget_class_install_style_property (widget_class, | ||
143 | + g_param_spec_boolean ("draw_trough_under_steppers", | ||
144 | + _("Draw trough under steppers"), | ||
145 | + _("Whether to draw trought for full length of range or exclude the steppers and spacing"), | ||
146 | + TRUE, | ||
147 | + G_PARAM_READABLE)); | ||
148 | + | ||
149 | + g_type_class_add_private (gobject_class, sizeof (OssoGtkRangePrivate)); | ||
150 | } | ||
151 | |||
152 | static void | ||
153 | @@ -415,6 +512,15 @@ | ||
154 | case PROP_INVERTED: | ||
155 | gtk_range_set_inverted (range, g_value_get_boolean (value)); | ||
156 | break; | ||
157 | + case PROP_STREAM_INDICATOR: | ||
158 | + osso_gtk_range_set_stream_indicator (range, g_value_get_boolean (value)); | ||
159 | + break; | ||
160 | + case PROP_STREAM_POSITION: | ||
161 | + osso_gtk_range_set_stream_position (range, g_value_get_double (value)); | ||
162 | + break; | ||
163 | + case PROP_MINIMUM_VISIBLE_BARS: | ||
164 | + range->layout->minimum_visible_bars = g_value_get_int(value); | ||
165 | + break; | ||
166 | default: | ||
167 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
168 | break; | ||
169 | @@ -442,6 +548,15 @@ | ||
170 | case PROP_INVERTED: | ||
171 | g_value_set_boolean (value, range->inverted); | ||
172 | break; | ||
173 | + case PROP_STREAM_INDICATOR: | ||
174 | + g_value_set_boolean (value, osso_gtk_range_get_stream_indicator (range)); | ||
175 | + break; | ||
176 | + case PROP_STREAM_POSITION: | ||
177 | + g_value_set_double (value, osso_gtk_range_get_stream_indicator (range)); | ||
178 | + break; | ||
179 | + case PROP_MINIMUM_VISIBLE_BARS: | ||
180 | + g_value_set_int (value, range->layout->minimum_visible_bars); | ||
181 | + break; | ||
182 | default: | ||
183 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
184 | break; | ||
185 | @@ -451,6 +566,7 @@ | ||
186 | static void | ||
187 | gtk_range_init (GtkRange *range) | ||
188 | { | ||
189 | + OssoGtkRangePrivate *priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
190 | GTK_WIDGET_SET_FLAGS (range, GTK_NO_WINDOW); | ||
191 | |||
192 | range->adjustment = NULL; | ||
193 | @@ -471,6 +587,9 @@ | ||
194 | range->layout->grab_location = MOUSE_OUTSIDE; | ||
195 | range->layout->grab_button = 0; | ||
196 | range->timer = NULL; | ||
197 | + | ||
198 | + priv->stream_indicator = FALSE; | ||
199 | + priv->stream_position = 0.0; | ||
200 | } | ||
201 | |||
202 | /** | ||
203 | @@ -584,7 +703,10 @@ | ||
204 | g_signal_connect (adjustment, "changed", | ||
205 | G_CALLBACK (gtk_range_adjustment_changed), | ||
206 | range); | ||
207 | - g_signal_connect (adjustment, "value_changed", | ||
208 | + /* OSSO modification : Changed for controlbar. | ||
209 | + * There we intercept this signal and put forth | ||
210 | + * our own, with modified parameters. */ | ||
211 | + g_signal_connect_after (adjustment, "value_changed", | ||
212 | G_CALLBACK (gtk_range_adjustment_value_changed), | ||
213 | range); | ||
214 | |||
215 | @@ -677,16 +799,21 @@ | ||
216 | gdouble max) | ||
217 | { | ||
218 | gdouble value; | ||
219 | + OssoGtkRangePrivate *priv; | ||
220 | |||
221 | g_return_if_fail (GTK_IS_RANGE (range)); | ||
222 | g_return_if_fail (min < max); | ||
223 | |||
224 | + priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
225 | + | ||
226 | range->adjustment->lower = min; | ||
227 | range->adjustment->upper = max; | ||
228 | |||
229 | value = CLAMP (range->adjustment->value, | ||
230 | range->adjustment->lower, | ||
231 | (range->adjustment->upper - range->adjustment->page_size)); | ||
232 | + if (priv->stream_indicator && value > priv->stream_position) | ||
233 | + value = (gdouble)priv->stream_position; | ||
234 | |||
235 | gtk_adjustment_set_value (range->adjustment, value); | ||
236 | gtk_adjustment_changed (range->adjustment); | ||
237 | @@ -707,10 +834,16 @@ | ||
238 | gtk_range_set_value (GtkRange *range, | ||
239 | gdouble value) | ||
240 | { | ||
241 | + OssoGtkRangePrivate *priv; | ||
242 | + | ||
243 | g_return_if_fail (GTK_IS_RANGE (range)); | ||
244 | |||
245 | + priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
246 | + | ||
247 | value = CLAMP (value, range->adjustment->lower, | ||
248 | (range->adjustment->upper - range->adjustment->page_size)); | ||
249 | + if (priv->stream_indicator && value > priv->stream_position) | ||
250 | + value = (gdouble)priv->stream_position; | ||
251 | |||
252 | gtk_adjustment_set_value (range->adjustment, value); | ||
253 | } | ||
254 | @@ -913,6 +1046,10 @@ | ||
255 | gint arrow_width; | ||
256 | gint arrow_height; | ||
257 | |||
258 | + /* OSSO modification: state of our style properties */ | ||
259 | + gboolean autodimmed_steppers = FALSE; | ||
260 | + gboolean arrow_paint_box_layout = FALSE; | ||
261 | + | ||
262 | /* More to get the right clip region than for efficiency */ | ||
263 | if (!gdk_rectangle_intersect (area, rect, &intersection)) | ||
264 | return; | ||
265 | @@ -929,6 +1066,37 @@ | ||
266 | else | ||
267 | state_type = GTK_STATE_NORMAL; | ||
268 | |||
269 | + /* OSSO modification : read all of our style properties needed in this func */ | ||
270 | + gtk_widget_style_get (widget, | ||
271 | + "autodimmed_steppers", &autodimmed_steppers, | ||
272 | + "arrow_paint_box_layout", &arrow_paint_box_layout, | ||
273 | + NULL); | ||
274 | + | ||
275 | + /* OSSO modification : dim the stepper if maximum or minimum value has been reached */ | ||
276 | + if (autodimmed_steppers) | ||
277 | + { | ||
278 | + OssoGtkRangePrivate *priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
279 | + if (((!range->inverted && (arrow_type == GTK_ARROW_DOWN || | ||
280 | + arrow_type == GTK_ARROW_RIGHT)) || | ||
281 | + (range->inverted && (arrow_type == GTK_ARROW_UP || | ||
282 | + arrow_type == GTK_ARROW_LEFT))) && | ||
283 | + range->adjustment->value >= | ||
284 | + (priv->stream_indicator | ||
285 | + ? priv->stream_position | ||
286 | + : range->adjustment->upper - range->adjustment->page_size)) | ||
287 | + { | ||
288 | + state_type = GTK_STATE_INSENSITIVE; | ||
289 | + } | ||
290 | + else if (((!range->inverted && (arrow_type == GTK_ARROW_UP || | ||
291 | + arrow_type == GTK_ARROW_LEFT)) || | ||
292 | + (range->inverted && (arrow_type == GTK_ARROW_DOWN || | ||
293 | + arrow_type == GTK_ARROW_RIGHT))) && | ||
294 | + range->adjustment->value <= range->adjustment->lower) | ||
295 | + { | ||
296 | + state_type = GTK_STATE_INSENSITIVE; | ||
297 | + } | ||
298 | + } | ||
299 | + | ||
300 | if (clicked) | ||
301 | shadow_type = GTK_SHADOW_IN; | ||
302 | else | ||
303 | @@ -944,10 +1112,20 @@ | ||
304 | rect->width, | ||
305 | rect->height); | ||
306 | |||
307 | - arrow_width = rect->width / 2; | ||
308 | - arrow_height = rect->height / 2; | ||
309 | - arrow_x = widget->allocation.x + rect->x + (rect->width - arrow_width) / 2; | ||
310 | - arrow_y = widget->allocation.y + rect->y + (rect->height - arrow_height) / 2; | ||
311 | + if (arrow_paint_box_layout) | ||
312 | + { | ||
313 | + arrow_width = rect->width; | ||
314 | + arrow_height = rect->height; | ||
315 | + arrow_x = widget->allocation.x + rect->x; | ||
316 | + arrow_y = widget->allocation.y + rect->y; | ||
317 | + } | ||
318 | + else | ||
319 | + { | ||
320 | + arrow_width = rect->width / 2; | ||
321 | + arrow_height = rect->height / 2; | ||
322 | + arrow_x = widget->allocation.x + rect->x + (rect->width - arrow_width) / 2; | ||
323 | + arrow_y = widget->allocation.y + rect->y + (rect->height - arrow_height) / 2; | ||
324 | + } | ||
325 | |||
326 | if (clicked) | ||
327 | { | ||
328 | @@ -982,8 +1160,11 @@ | ||
329 | GdkRectangle area; | ||
330 | gint focus_line_width = 0; | ||
331 | gint focus_padding = 0; | ||
332 | + OssoGtkRangePrivate *priv; | ||
333 | |||
334 | range = GTK_RANGE (widget); | ||
335 | + | ||
336 | + priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
337 | |||
338 | if (GTK_WIDGET_CAN_FOCUS (range)) | ||
339 | { | ||
340 | @@ -1011,18 +1192,118 @@ | ||
341 | if (gdk_rectangle_intersect (&expose_area, &range->range_rect, | ||
342 | &area)) | ||
343 | { | ||
344 | + gint x = widget->allocation.x + range->range_rect.x + focus_line_width + focus_padding; | ||
345 | + gint y = widget->allocation.y + range->range_rect.y + focus_line_width + focus_padding; | ||
346 | + gint width = range->range_rect.width - 2 * (focus_line_width + focus_padding); | ||
347 | + gint height = range->range_rect.height - 2 * (focus_line_width + focus_padding); | ||
348 | + gint *virtual_position, *virtual_size; | ||
349 | + gboolean two_part_trough = 0; | ||
350 | + gint stepper_size = 0; | ||
351 | + gint stepper_spacing = 0; | ||
352 | + gboolean draw_trough_under_steppers = TRUE; | ||
353 | + | ||
354 | area.x += widget->allocation.x; | ||
355 | area.y += widget->allocation.y; | ||
356 | + | ||
357 | + gtk_widget_style_get (GTK_WIDGET (range), | ||
358 | + "two_part_trough", &two_part_trough, | ||
359 | + "stepper_size", &stepper_size, | ||
360 | + "stepper_spacing", &stepper_spacing, | ||
361 | + "draw_trough_under_steppers", &draw_trough_under_steppers, | ||
362 | + NULL); | ||
363 | + | ||
364 | + if (range->orientation == GTK_ORIENTATION_HORIZONTAL) | ||
365 | + { | ||
366 | + virtual_position = &x; | ||
367 | + virtual_size = &width; | ||
368 | + } | ||
369 | + else | ||
370 | + { | ||
371 | + virtual_position = &y; | ||
372 | + virtual_size = &height; | ||
373 | + } | ||
374 | + | ||
375 | + if (draw_trough_under_steppers == FALSE) | ||
376 | + { | ||
377 | + *virtual_position += stepper_size + stepper_spacing; | ||
378 | + *virtual_size -= 2 * (stepper_size + stepper_spacing); | ||
379 | + } | ||
380 | |||
381 | - gtk_paint_box (widget->style, | ||
382 | - widget->window, | ||
383 | - sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, | ||
384 | - GTK_SHADOW_IN, | ||
385 | - &area, GTK_WIDGET(range), "trough", | ||
386 | - widget->allocation.x + range->range_rect.x + focus_line_width + focus_padding, | ||
387 | - widget->allocation.y + range->range_rect.y + focus_line_width + focus_padding, | ||
388 | - range->range_rect.width - 2 * (focus_line_width + focus_padding), | ||
389 | - range->range_rect.height - 2 * (focus_line_width + focus_padding)); | ||
390 | + if (two_part_trough == FALSE) | ||
391 | + { | ||
392 | + gtk_paint_box (widget->style, | ||
393 | + widget->window, | ||
394 | + sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, | ||
395 | + GTK_SHADOW_IN, | ||
396 | + &area, GTK_WIDGET(range), "trough", | ||
397 | + x, y, | ||
398 | + width, height); | ||
399 | + } | ||
400 | + else | ||
401 | + { | ||
402 | + gint trough_change_pos_x = width; | ||
403 | + gint trough_change_pos_y = height; | ||
404 | + | ||
405 | + if (range->orientation == GTK_ORIENTATION_HORIZONTAL) | ||
406 | + trough_change_pos_x = range->layout->slider.x + (range->layout->slider.width / 2) - stepper_size - stepper_spacing; | ||
407 | + else | ||
408 | + trough_change_pos_y = range->layout->slider.y + (range->layout->slider.height / 2) - stepper_size - stepper_spacing; | ||
409 | + | ||
410 | + gtk_paint_box (widget->style, | ||
411 | + widget->window, | ||
412 | + sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, | ||
413 | + GTK_SHADOW_IN, | ||
414 | + &area, GTK_WIDGET(range), "trough_northwest", | ||
415 | + x, y, | ||
416 | + trough_change_pos_x, trough_change_pos_y); | ||
417 | + | ||
418 | + if (range->orientation == GTK_ORIENTATION_HORIZONTAL) | ||
419 | + trough_change_pos_y = 0; | ||
420 | + else | ||
421 | + trough_change_pos_x = 0; | ||
422 | + | ||
423 | + gtk_paint_box (widget->style, | ||
424 | + widget->window, | ||
425 | + sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, | ||
426 | + GTK_SHADOW_IN, | ||
427 | + &area, GTK_WIDGET(range), "trough_southeast", | ||
428 | + x + trough_change_pos_x, y + trough_change_pos_y, | ||
429 | + width - trough_change_pos_x, height - trough_change_pos_y); | ||
430 | + } | ||
431 | + | ||
432 | + /* Stream indicator drawing does not support inverted state. */ | ||
433 | + if (priv->stream_indicator) | ||
434 | + { | ||
435 | + gchar *used_detail; | ||
436 | + gint stream_start_pos_x = 0; | ||
437 | + gint stream_start_pos_y = 0; | ||
438 | + gint stream_width = width; | ||
439 | + gint stream_height = height; | ||
440 | + | ||
441 | + if (range->orientation == GTK_ORIENTATION_HORIZONTAL) | ||
442 | + { | ||
443 | + stream_start_pos_x = range->layout->slider.x; | ||
444 | + stream_width = range->layout->stream_pixel_position - stream_start_pos_x; | ||
445 | + } | ||
446 | + else | ||
447 | + { | ||
448 | + stream_start_pos_y = range->layout->slider.y; | ||
449 | + stream_height = range->layout->stream_pixel_position - stream_start_pos_y; | ||
450 | + } | ||
451 | + | ||
452 | + if (priv->stream_position == range->adjustment->upper) | ||
453 | + used_detail = "trough_stream_complete"; | ||
454 | + else | ||
455 | + used_detail = "trough_stream"; | ||
456 | + | ||
457 | + gtk_paint_box (widget->style, | ||
458 | + widget->window, | ||
459 | + sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, | ||
460 | + GTK_SHADOW_IN, | ||
461 | + &area, GTK_WIDGET(range), used_detail, | ||
462 | + widget->allocation.x + stream_start_pos_x, widget->allocation.y + stream_start_pos_y, | ||
463 | + stream_width, stream_height); | ||
464 | + } | ||
465 | |||
466 | |||
467 | if (sensitive && | ||
468 | @@ -1189,19 +1470,41 @@ | ||
469 | { | ||
470 | gdouble frac; | ||
471 | gdouble value; | ||
472 | - | ||
473 | - if (range->orientation == GTK_ORIENTATION_VERTICAL) | ||
474 | + gint stepper_spacing = 0; | ||
475 | + gint minimum_visible_blocks = 0; | ||
476 | + gint magic_value = 0; | ||
477 | + | ||
478 | + g_object_get(range, "minimum_visible_bars", &minimum_visible_blocks, NULL); | ||
479 | + | ||
480 | + g_print("coord = %d\n", coord); | ||
481 | + gtk_widget_style_get (GTK_WIDGET (range), | ||
482 | + "stepper_spacing", &stepper_spacing, | ||
483 | + NULL); | ||
484 | + | ||
485 | + if (range->orientation == GTK_ORIENTATION_VERTICAL) { | ||
486 | + if (minimum_visible_blocks > 0) | ||
487 | + magic_value = ((range->layout->trough.height -(2*stepper_spacing)) / (range->adjustment->upper - range->adjustment->lower + 1)) * minimum_visible_blocks; | ||
488 | if (range->layout->trough.height == range->layout->slider.height) | ||
489 | frac = 1.0; | ||
490 | else | ||
491 | - frac = ((coord - range->layout->trough.y) / | ||
492 | - (gdouble) (range->layout->trough.height - range->layout->slider.height)); | ||
493 | - else | ||
494 | + frac = ((coord - range->layout->trough.y - magic_value - stepper_spacing) / | ||
495 | + (gdouble) (range->layout->trough.height - magic_value - range->layout->slider.height - (2 * stepper_spacing))); | ||
496 | + } | ||
497 | + else { | ||
498 | + if (minimum_visible_blocks > 0) | ||
499 | + magic_value = ((range->layout->trough.width -(2*stepper_spacing)) / (range->adjustment->upper - range->adjustment->lower + 1)) * minimum_visible_blocks; | ||
500 | if (range->layout->trough.width == range->layout->slider.width) | ||
501 | frac = 1.0; | ||
502 | else | ||
503 | - frac = ((coord - range->layout->trough.x) / | ||
504 | - (gdouble) (range->layout->trough.width - range->layout->slider.width)); | ||
505 | + frac = ((coord - range->layout->trough.x - magic_value - stepper_spacing) / | ||
506 | + (gdouble) (range->layout->trough.width - magic_value - range->layout->slider.width - (2 * stepper_spacing))); | ||
507 | + } | ||
508 | + | ||
509 | + if (frac < 0.0) | ||
510 | + frac = 0.0; | ||
511 | + else | ||
512 | + if (frac > 1.0) | ||
513 | + frac = 1.0; | ||
514 | |||
515 | if (should_invert (range)) | ||
516 | frac = 1.0 - frac; | ||
517 | @@ -1242,6 +1545,8 @@ | ||
518 | range->orientation == GTK_ORIENTATION_VERTICAL ? | ||
519 | event->y : event->x); | ||
520 | |||
521 | + g_print("button_press: calling coord_to_value with %d, click value = %d\n", event->x, click_value); | ||
522 | + | ||
523 | range->trough_click_forward = click_value > range->adjustment->value; | ||
524 | range_grab_add (range, MOUSE_TROUGH, event->button); | ||
525 | |||
526 | @@ -1286,7 +1591,9 @@ | ||
527 | * On button 2 press, we warp the slider to mouse position, | ||
528 | * then begin the slider drag. | ||
529 | */ | ||
530 | - if (event->button == 2) | ||
531 | + /* OSSO modification : We want this to be | ||
532 | + * the default behaviour. */ | ||
533 | + if (range->layout->mouse_location == MOUSE_TROUGH) | ||
534 | { | ||
535 | gdouble slider_low_value, slider_high_value, new_value; | ||
536 | |||
537 | @@ -1299,7 +1606,10 @@ | ||
538 | range->orientation == GTK_ORIENTATION_VERTICAL ? | ||
539 | event->y - range->layout->slider.height : | ||
540 | event->x - range->layout->slider.width); | ||
541 | - | ||
542 | + | ||
543 | + g_print("calling coord_to_value with %d\n", event->x); | ||
544 | + g_print("calling coord_to_value with %d\n", range->orientation == GTK_ORIENTATION_VERTICAL? event->y-range->layout->slider.height:event->x-range->layout->slider.width); | ||
545 | + | ||
546 | /* compute new value for warped slider */ | ||
547 | new_value = slider_low_value + (slider_high_value - slider_low_value) / 2; | ||
548 | |||
549 | @@ -1353,8 +1663,10 @@ | ||
550 | else | ||
551 | delta = mouse_x - range->slide_initial_coordinate; | ||
552 | |||
553 | + delta += -4; | ||
554 | c = range->slide_initial_slider_position + delta; | ||
555 | |||
556 | + g_print("delta = %d, calling coord_to_value with %d + delta = %d\n", delta, range->slide_initial_slider_position, c); | ||
557 | new_value = coord_to_value (range, c); | ||
558 | |||
559 | g_signal_emit (range, signals[CHANGE_VALUE], 0, GTK_SCROLL_JUMP, new_value, | ||
560 | @@ -1395,9 +1707,12 @@ | ||
561 | |||
562 | if (range->layout->grab_button == event->button) | ||
563 | { | ||
564 | + /* OSSO modification : Commented out. | ||
565 | + * Not sure about the reason unfortunately. */ | ||
566 | +/* | ||
567 | if (range->layout->grab_location == MOUSE_SLIDER) | ||
568 | update_slider_position (range, range->layout->mouse_x, range->layout->mouse_y); | ||
569 | - | ||
570 | +*/ | ||
571 | stop_scrolling (range); | ||
572 | |||
573 | return TRUE; | ||
574 | @@ -2026,6 +2341,7 @@ | ||
575 | GdkRectangle range_rect; | ||
576 | GtkRangeLayout *layout; | ||
577 | GtkWidget *widget; | ||
578 | + gint minimum_visible_bars = 0; | ||
579 | |||
580 | if (!range->need_recalc) | ||
581 | return; | ||
582 | @@ -2047,6 +2363,8 @@ | ||
583 | &slider_width, &stepper_size, &trough_border, &stepper_spacing, | ||
584 | NULL, NULL); | ||
585 | |||
586 | + g_object_get(range, "minimum_visible_bars", &minimum_visible_bars, NULL); | ||
587 | + | ||
588 | gtk_range_calc_request (range, | ||
589 | slider_width, stepper_size, trough_border, stepper_spacing, | ||
590 | &range_rect, &border, &n_steppers, &slider_length); | ||
591 | @@ -2167,10 +2485,13 @@ | ||
592 | /* Compute slider position/length */ | ||
593 | { | ||
594 | gint y, bottom, top, height; | ||
595 | - | ||
596 | - top = layout->trough.y + stepper_spacing; | ||
597 | - bottom = layout->trough.y + layout->trough.height - stepper_spacing; | ||
598 | - | ||
599 | + gint magic_value; | ||
600 | + | ||
601 | + magic_value = (layout->trough.height / (range->adjustment->upper - range->adjustment->lower + 1)); | ||
602 | + | ||
603 | + top = layout->trough.y + stepper_spacing + (minimum_visible_bars * magic_value); | ||
604 | + bottom = layout->trough.y + layout->trough.height - stepper_spacing; | ||
605 | + | ||
606 | /* slider height is the fraction (page_size / | ||
607 | * total_adjustment_range) times the trough height in pixels | ||
608 | */ | ||
609 | @@ -2307,8 +2628,11 @@ | ||
610 | /* Compute slider position/length */ | ||
611 | { | ||
612 | gint x, left, right, width; | ||
613 | + gint magic_value; | ||
614 | + | ||
615 | + magic_value = (layout->trough.width / (range->adjustment->upper - range->adjustment->lower + 1)); | ||
616 | |||
617 | - left = layout->trough.x + stepper_spacing; | ||
618 | + left = layout->trough.x + stepper_spacing + (minimum_visible_bars * magic_value); | ||
619 | right = layout->trough.x + layout->trough.width - stepper_spacing; | ||
620 | |||
621 | /* slider width is the fraction (page_size / | ||
622 | @@ -2340,6 +2664,32 @@ | ||
623 | |||
624 | layout->slider.x = x; | ||
625 | layout->slider.width = width; | ||
626 | + | ||
627 | + /* Hildon modification : Calculate the x point of streaming | ||
628 | + * indicator. | ||
629 | + */ | ||
630 | + { | ||
631 | + gint stream_indicator_padding = 0; | ||
632 | + OssoGtkRangePrivate *priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
633 | + gtk_widget_style_get (widget, | ||
634 | + "stream_indicator_padding", &stream_indicator_padding, | ||
635 | + NULL); | ||
636 | + | ||
637 | + if (priv->stream_indicator == TRUE) | ||
638 | + { | ||
639 | + if (range->adjustment->upper - range->adjustment->lower != 0) | ||
640 | + layout->stream_pixel_position = | ||
641 | + (right - left - (2 * stream_indicator_padding)) * | ||
642 | + ((priv->stream_position - range->adjustment->lower) / | ||
643 | + (range->adjustment->upper - range->adjustment->lower)) + | ||
644 | + left + stream_indicator_padding; | ||
645 | + else | ||
646 | + layout->stream_pixel_position = left + stream_indicator_padding; | ||
647 | + | ||
648 | + if (layout->stream_pixel_position < left + stream_indicator_padding) | ||
649 | + layout->stream_pixel_position = left + stream_indicator_padding; | ||
650 | + } | ||
651 | + } | ||
652 | |||
653 | /* These are publically exported */ | ||
654 | range->slider_start = layout->slider.x; | ||
655 | @@ -2382,12 +2732,17 @@ | ||
656 | GtkScrollType scroll, | ||
657 | gdouble value) | ||
658 | { | ||
659 | + OssoGtkRangePrivate *priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
660 | + | ||
661 | /* potentially adjust the bounds _before we clamp */ | ||
662 | g_signal_emit (range, signals[ADJUST_BOUNDS], 0, value); | ||
663 | |||
664 | value = CLAMP (value, range->adjustment->lower, | ||
665 | (range->adjustment->upper - range->adjustment->page_size)); | ||
666 | |||
667 | + if (priv->stream_indicator && value > priv->stream_position) | ||
668 | + value = (gdouble)priv->stream_position; | ||
669 | + | ||
670 | if (range->round_digits >= 0) | ||
671 | { | ||
672 | gdouble power; | ||
673 | @@ -2465,11 +2820,16 @@ | ||
674 | initial_timeout (gpointer data) | ||
675 | { | ||
676 | GtkRange *range; | ||
677 | + GtkSettings *settings; | ||
678 | + guint timeout = SCROLL_LATER_DELAY; | ||
679 | + | ||
680 | + settings = gtk_settings_get_default (); | ||
681 | + g_object_get (settings, "gtk-update-timeout", &timeout, NULL); | ||
682 | |||
683 | GDK_THREADS_ENTER (); | ||
684 | range = GTK_RANGE (data); | ||
685 | range->timer->timeout_id = | ||
686 | - g_timeout_add (SCROLL_LATER_DELAY, | ||
687 | + g_timeout_add (/*SCROLL_LATER_DELAY*/timeout, | ||
688 | second_timeout, | ||
689 | range); | ||
690 | GDK_THREADS_LEAVE (); | ||
691 | @@ -2482,13 +2842,19 @@ | ||
692 | gtk_range_add_step_timer (GtkRange *range, | ||
693 | GtkScrollType step) | ||
694 | { | ||
695 | + GtkSettings *settings; | ||
696 | + guint timeout = SCROLL_INITIAL_DELAY; | ||
697 | + | ||
698 | g_return_if_fail (range->timer == NULL); | ||
699 | g_return_if_fail (step != GTK_SCROLL_NONE); | ||
700 | |||
701 | + settings = gtk_settings_get_default (); | ||
702 | + g_object_get (settings, "gtk-initial-timeout", &timeout, NULL); | ||
703 | + | ||
704 | range->timer = g_new (GtkRangeStepTimer, 1); | ||
705 | |||
706 | range->timer->timeout_id = | ||
707 | - g_timeout_add (SCROLL_INITIAL_DELAY, | ||
708 | + g_timeout_add (/*SCROLL_INITIAL_DELAY*/timeout, | ||
709 | initial_timeout, | ||
710 | range); | ||
711 | range->timer->step = step; | ||
712 | @@ -2528,9 +2894,15 @@ | ||
713 | static void | ||
714 | gtk_range_reset_update_timer (GtkRange *range) | ||
715 | { | ||
716 | + /*GtkSettings *settings; | ||
717 | + guint timeout = UPDATE_DELAY; | ||
718 | + | ||
719 | + settings = gtk_settings_get_default (); | ||
720 | + g_object_get (settings, "gtk-update-timeout", &timeout, NULL);*/ | ||
721 | + | ||
722 | gtk_range_remove_update_timer (range); | ||
723 | |||
724 | - range->update_timeout_id = g_timeout_add (UPDATE_DELAY, | ||
725 | + range->update_timeout_id = g_timeout_add (/*timeout*/UPDATE_DELAY, | ||
726 | update_timeout, | ||
727 | range); | ||
728 | } | ||
729 | @@ -2544,3 +2916,116 @@ | ||
730 | range->update_timeout_id = 0; | ||
731 | } | ||
732 | } | ||
733 | + | ||
734 | +/** | ||
735 | + * osso_gtk_range_set_stream_indicator: | ||
736 | + * @range: A GtkRange | ||
737 | + * @stream_indicator: Whether stream indicator graphics is shown and restricts slider. | ||
738 | + * | ||
739 | + * Sets whether a graphical stream indicator | ||
740 | + * is show on the trough and the slider is restricted | ||
741 | + * to streamed area. | ||
742 | + **/ | ||
743 | +void | ||
744 | +osso_gtk_range_set_stream_indicator (GtkRange *range, gboolean stream_indicator) | ||
745 | +{ | ||
746 | + OssoGtkRangePrivate *priv; | ||
747 | + | ||
748 | + g_return_if_fail (GTK_IS_RANGE (range)); | ||
749 | + | ||
750 | + priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
751 | + | ||
752 | + if (stream_indicator == priv->stream_indicator) | ||
753 | + return; | ||
754 | + | ||
755 | + priv->stream_indicator = stream_indicator; | ||
756 | + g_signal_emit_by_name (G_OBJECT (range), "value_changed", NULL); | ||
757 | +} | ||
758 | + | ||
759 | +/** | ||
760 | + * osso_gtk_range_get_stream_indicator: | ||
761 | + * @range: A GtkRange | ||
762 | + * | ||
763 | + * Return value: Whether GtkRange displays an | ||
764 | + * stream indicator graphics and slider is restricted | ||
765 | + * to streamed area | ||
766 | + **/ | ||
767 | +gboolean | ||
768 | +osso_gtk_range_get_stream_indicator (GtkRange *range) | ||
769 | +{ | ||
770 | + OssoGtkRangePrivate *priv; | ||
771 | + | ||
772 | + g_return_val_if_fail (GTK_IS_RANGE (range), FALSE); | ||
773 | + | ||
774 | + priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
775 | + | ||
776 | + return priv->stream_indicator; | ||
777 | +} | ||
778 | + | ||
779 | +/** | ||
780 | + * osso_gtk_range_set_stream_position: | ||
781 | + * @range : A GtkRange | ||
782 | + * @position : The new position of the stream indicator | ||
783 | + * | ||
784 | + * Sets the new position of the stream indicator. | ||
785 | + * It is automatically clamped between lower and upper. | ||
786 | + * Note that you need to enable stream_indicator | ||
787 | + * before any stream-functionality is active. | ||
788 | + **/ | ||
789 | +void | ||
790 | +osso_gtk_range_set_stream_position (GtkRange *range, | ||
791 | + gdouble position) | ||
792 | +{ | ||
793 | + OssoGtkRangePrivate *priv; | ||
794 | + gdouble new_pos; | ||
795 | + | ||
796 | + g_return_if_fail (GTK_IS_RANGE (range)); | ||
797 | + | ||
798 | + new_pos = CLAMP (position, | ||
799 | + range->adjustment->lower, | ||
800 | + range->adjustment->upper); | ||
801 | + priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
802 | + | ||
803 | + priv->stream_position = new_pos; | ||
804 | + /* Reset the value to clamp it with the stream_position. */ | ||
805 | + if (priv->stream_indicator == TRUE) | ||
806 | + gtk_range_set_value (range, gtk_range_get_value (range)); | ||
807 | + | ||
808 | + g_object_notify (G_OBJECT (range), "stream_position"); | ||
809 | +} | ||
810 | +/** | ||
811 | + * osso_gtk_range_get_stream_position: | ||
812 | + * @range : A GtkRange | ||
813 | + * | ||
814 | + * Return value: The current position of the stream | ||
815 | + * indicator. Note that this value is undefined | ||
816 | + * when stream indicator is not enabled. | ||
817 | + **/ | ||
818 | +gdouble | ||
819 | +osso_gtk_range_get_stream_position (GtkRange *range) | ||
820 | +{ | ||
821 | + OssoGtkRangePrivate *priv; | ||
822 | + | ||
823 | + g_return_if_fail (GTK_IS_RANGE (range)); | ||
824 | + | ||
825 | + priv = OSSO_GTK_RANGE_GET_PRIVATE (range); | ||
826 | + | ||
827 | + return priv->stream_position; | ||
828 | +} | ||
829 | + | ||
830 | +/* OSSO addition : A function to ensure that | ||
831 | + * scrolling stops if widget loses focus (example: | ||
832 | + * dialog pops up) */ | ||
833 | +static gint | ||
834 | +osso_gtk_range_focus_out (GtkWidget *widget, GdkEventFocus *event) | ||
835 | +{ | ||
836 | + gboolean hildonlike; | ||
837 | + | ||
838 | + gtk_widget_style_get (widget, "hildonlike", &hildonlike, NULL); | ||
839 | + | ||
840 | + if (hildonlike) | ||
841 | + { | ||
842 | + stop_scrolling (GTK_RANGE (widget)); | ||
843 | + } | ||
844 | + return GTK_WIDGET_CLASS (parent_class)->focus_out_event (widget, event); | ||
845 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrange.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrange.h.diff deleted file mode 100644 index a48acfaad5..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrange.h.diff +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkrange.h 2004-08-27 05:54:12.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkrange.h 2005-04-06 16:19:37.798792072 +0300 | ||
3 | @@ -24,6 +24,10 @@ | ||
4 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
5 | */ | ||
6 | |||
7 | +/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list | ||
8 | + * of changes. | ||
9 | + */ | ||
10 | + | ||
11 | #ifndef __GTK_RANGE_H__ | ||
12 | #define __GTK_RANGE_H__ | ||
13 | |||
14 | @@ -155,6 +159,15 @@ | ||
15 | gdouble _gtk_range_get_wheel_delta (GtkRange *range, | ||
16 | GdkScrollDirection direction); | ||
17 | |||
18 | +/* OSSO additions for streaming indicator support. */ | ||
19 | +void osso_gtk_range_set_stream_indicator (GtkRange *range, | ||
20 | + gboolean stream_indicator); | ||
21 | +gboolean osso_gtk_range_get_stream_indicator (GtkRange *range); | ||
22 | + | ||
23 | +void osso_gtk_range_set_stream_position (GtkRange *range, | ||
24 | + gdouble position); | ||
25 | +gdouble osso_gtk_range_get_stream_position (GtkRange *range); | ||
26 | + | ||
27 | #ifdef __cplusplus | ||
28 | } | ||
29 | #endif /* __cplusplus */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrbtree.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrbtree.c.diff deleted file mode 100644 index 1e34b3f2e7..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrbtree.c.diff +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkrbtree.c 2004-10-28 18:00:04.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkrbtree.c 2005-04-06 16:19:37.812789944 +0300 | ||
3 | @@ -1378,18 +1378,18 @@ | ||
4 | g_return_val_if_fail (node != NULL, NULL); | ||
5 | |||
6 | /* Case 1: the node's below us. */ | ||
7 | - if (node->right != tree->nil) | ||
8 | + if (node && node->right != tree->nil) | ||
9 | { | ||
10 | node = node->right; | ||
11 | - while (node->left != tree->nil) | ||
12 | + while (node && node->left != tree->nil) | ||
13 | node = node->left; | ||
14 | return node; | ||
15 | } | ||
16 | |||
17 | /* Case 2: it's an ancestor */ | ||
18 | - while (node->parent != tree->nil) | ||
19 | + while (node && node->parent != tree->nil) | ||
20 | { | ||
21 | - if (node->parent->right == node) | ||
22 | + if (node->parent && node->parent->right == node) | ||
23 | node = node->parent; | ||
24 | else | ||
25 | return (node->parent); | ||
26 | @@ -1407,18 +1407,18 @@ | ||
27 | g_return_val_if_fail (node != NULL, NULL); | ||
28 | |||
29 | /* Case 1: the node's below us. */ | ||
30 | - if (node->left != tree->nil) | ||
31 | + if (node != NULL && node->left != tree->nil) | ||
32 | { | ||
33 | node = node->left; | ||
34 | - while (node->right != tree->nil) | ||
35 | + while (node != NULL && node->right != tree->nil) | ||
36 | node = node->right; | ||
37 | return node; | ||
38 | } | ||
39 | |||
40 | /* Case 2: it's an ancestor */ | ||
41 | - while (node->parent != tree->nil) | ||
42 | + while (node != NULL && node->parent != tree->nil) | ||
43 | { | ||
44 | - if (node->parent->left == node) | ||
45 | + if (node->parent && node->parent->left == node) | ||
46 | node = node->parent; | ||
47 | else | ||
48 | return (node->parent); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrc.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrc.c.diff deleted file mode 100644 index a6b4f999ac..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrc.c.diff +++ /dev/null | |||
@@ -1,581 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkrc.c 2005-02-01 20:07:40.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkrc.c 2005-04-06 16:19:37.848784472 +0300 | ||
3 | @@ -56,6 +56,7 @@ | ||
4 | #include "gtkprivate.h" | ||
5 | #include "gtksettings.h" | ||
6 | #include "gtkwindow.h" | ||
7 | +#include "gtkhashtable.h" | ||
8 | |||
9 | #ifdef G_OS_WIN32 | ||
10 | #include <io.h> | ||
11 | @@ -105,6 +106,14 @@ | ||
12 | GtkStyle *default_style; | ||
13 | }; | ||
14 | |||
15 | +#define GTK_RC_STYLE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_RC_STYLE, GtkRcStylePrivate)) | ||
16 | + | ||
17 | +typedef struct _GtkRcStylePrivate GtkRcStylePrivate; | ||
18 | + | ||
19 | +struct _GtkRcStylePrivate { | ||
20 | + GSList *logical_color_hashes; | ||
21 | +}; | ||
22 | + | ||
23 | static GtkRcContext *gtk_rc_context_get (GtkSettings *settings); | ||
24 | |||
25 | static guint gtk_rc_style_hash (const gchar *name); | ||
26 | @@ -179,6 +188,13 @@ | ||
27 | GScanner *scanner, | ||
28 | GtkRcStyle *rc_style, | ||
29 | GtkIconFactory *factory); | ||
30 | +static guint gtk_rc_parse_logical_color (GScanner *scanner, | ||
31 | + GtkRcStyle *rc_style, | ||
32 | + GtkHashTable *hash); | ||
33 | +static guint gtk_rc_parse_color_full (GScanner *scanner, | ||
34 | + GdkColor *color, | ||
35 | + GtkRcStyle *style); | ||
36 | + | ||
37 | static void gtk_rc_clear_hash_node (gpointer key, | ||
38 | gpointer data, | ||
39 | gpointer user_data); | ||
40 | @@ -277,7 +293,8 @@ | ||
41 | { "stock", GTK_RC_TOKEN_STOCK }, | ||
42 | { "im_module_file", GTK_RC_TOKEN_IM_MODULE_FILE }, | ||
43 | { "LTR", GTK_RC_TOKEN_LTR }, | ||
44 | - { "RTL", GTK_RC_TOKEN_RTL } | ||
45 | + { "RTL", GTK_RC_TOKEN_RTL }, | ||
46 | + { "logical_color", GTK_RC_TOKEN_LOGICAL_COLOR } | ||
47 | }; | ||
48 | |||
49 | static GHashTable *realized_style_ht = NULL; | ||
50 | @@ -954,6 +971,7 @@ | ||
51 | static void | ||
52 | gtk_rc_style_init (GtkRcStyle *style) | ||
53 | { | ||
54 | + GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (style); | ||
55 | guint i; | ||
56 | |||
57 | style->name = NULL; | ||
58 | @@ -976,6 +994,7 @@ | ||
59 | |||
60 | style->rc_style_lists = NULL; | ||
61 | style->icon_factories = NULL; | ||
62 | + priv->logical_color_hashes = NULL; | ||
63 | } | ||
64 | |||
65 | static void | ||
66 | @@ -991,6 +1010,21 @@ | ||
67 | klass->create_rc_style = gtk_rc_style_real_create_rc_style; | ||
68 | klass->merge = gtk_rc_style_real_merge; | ||
69 | klass->create_style = gtk_rc_style_real_create_style; | ||
70 | + | ||
71 | + g_type_class_add_private (object_class, sizeof (GtkRcStylePrivate)); | ||
72 | +} | ||
73 | + | ||
74 | +static void | ||
75 | +free_object_list (GSList *list) | ||
76 | +{ | ||
77 | + GSList *tmp_list = list; | ||
78 | + while (tmp_list) | ||
79 | + { | ||
80 | + g_object_unref (tmp_list->data); | ||
81 | + tmp_list = tmp_list->next; | ||
82 | + } | ||
83 | + g_slist_free (list); | ||
84 | + | ||
85 | } | ||
86 | |||
87 | static void | ||
88 | @@ -998,9 +1032,11 @@ | ||
89 | { | ||
90 | GSList *tmp_list1, *tmp_list2; | ||
91 | GtkRcStyle *rc_style; | ||
92 | + GtkRcStylePrivate *rc_priv; | ||
93 | gint i; | ||
94 | |||
95 | rc_style = GTK_RC_STYLE (object); | ||
96 | + rc_priv = GTK_RC_STYLE_GET_PRIVATE (rc_style); | ||
97 | |||
98 | if (rc_style->name) | ||
99 | g_free (rc_style->name); | ||
100 | @@ -1059,13 +1095,8 @@ | ||
101 | rc_style->rc_properties = NULL; | ||
102 | } | ||
103 | |||
104 | - tmp_list1 = rc_style->icon_factories; | ||
105 | - while (tmp_list1) | ||
106 | - { | ||
107 | - g_object_unref (tmp_list1->data); | ||
108 | - tmp_list1 = tmp_list1->next; | ||
109 | - } | ||
110 | - g_slist_free (rc_style->icon_factories); | ||
111 | + free_object_list (rc_style->icon_factories); | ||
112 | + free_object_list (rc_priv->logical_color_hashes); | ||
113 | |||
114 | G_OBJECT_CLASS (parent_class)->finalize (object); | ||
115 | } | ||
116 | @@ -1125,6 +1156,14 @@ | ||
117 | return g_object_new (G_OBJECT_TYPE (style), NULL); | ||
118 | } | ||
119 | |||
120 | +GSList * | ||
121 | +_gtk_rc_style_get_logical_color_hashes (GtkRcStyle *rc_style) | ||
122 | +{ | ||
123 | + GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (rc_style); | ||
124 | + | ||
125 | + return priv->logical_color_hashes; | ||
126 | +} | ||
127 | + | ||
128 | static gint | ||
129 | gtk_rc_properties_cmp (gconstpointer bsearch_node1, | ||
130 | gconstpointer bsearch_node2) | ||
131 | @@ -1499,6 +1538,22 @@ | ||
132 | context->rc_files = NULL; | ||
133 | |||
134 | gtk_rc_parse_default_files (context); | ||
135 | +/*Hildon- Swapped these sections of code, so the styles from the | ||
136 | + XSettings theme are available when parsing with gtk_rc_context_parse_string*/ | ||
137 | + g_free (context->theme_name); | ||
138 | + g_free (context->key_theme_name); | ||
139 | + | ||
140 | + g_object_get (context->settings, | ||
141 | + "gtk-theme-name", &context->theme_name, | ||
142 | + "gtk-key-theme-name", &context->key_theme_name, | ||
143 | + NULL); | ||
144 | + | ||
145 | + if (context->theme_name && context->theme_name[0]) | ||
146 | + gtk_rc_parse_named (context, context->theme_name, NULL); | ||
147 | + if (context->key_theme_name && context->key_theme_name[0]) | ||
148 | + gtk_rc_parse_named (context, context->key_theme_name, "key"); | ||
149 | + | ||
150 | +/*****/ | ||
151 | |||
152 | tmp_list = global_rc_files; | ||
153 | while (tmp_list) | ||
154 | @@ -1512,19 +1567,6 @@ | ||
155 | |||
156 | tmp_list = tmp_list->next; | ||
157 | } | ||
158 | - | ||
159 | - g_free (context->theme_name); | ||
160 | - g_free (context->key_theme_name); | ||
161 | - | ||
162 | - g_object_get (context->settings, | ||
163 | - "gtk-theme-name", &context->theme_name, | ||
164 | - "gtk-key-theme-name", &context->key_theme_name, | ||
165 | - NULL); | ||
166 | - | ||
167 | - if (context->theme_name && context->theme_name[0]) | ||
168 | - gtk_rc_parse_named (context, context->theme_name, NULL); | ||
169 | - if (context->key_theme_name && context->key_theme_name[0]) | ||
170 | - gtk_rc_parse_named (context, context->key_theme_name, "key"); | ||
171 | |||
172 | g_object_thaw_notify (G_OBJECT (context->settings)); | ||
173 | |||
174 | @@ -1905,10 +1947,19 @@ | ||
175 | { | ||
176 | GScanner *scanner; | ||
177 | guint i; | ||
178 | + gchar *name_str; | ||
179 | gboolean done; | ||
180 | |||
181 | scanner = gtk_rc_scanner_new (); | ||
182 | |||
183 | + if (input_name != NULL) | ||
184 | + { | ||
185 | + name_str = (gchar *) g_malloc(strlen(input_name) + 7); | ||
186 | + sprintf(name_str, "%s.cache", input_name); | ||
187 | + /*osso_g_scanner_cache_open (scanner, name_str);*/ | ||
188 | + g_free(name_str); | ||
189 | + } | ||
190 | + | ||
191 | if (input_fd >= 0) | ||
192 | { | ||
193 | g_assert (input_string == NULL); | ||
194 | @@ -2062,6 +2113,29 @@ | ||
195 | return style; | ||
196 | } | ||
197 | |||
198 | +static GSList * | ||
199 | +concat_object_lists (GSList *list_a, GSList *list_b) | ||
200 | +{ | ||
201 | + GSList *copy; | ||
202 | + | ||
203 | + copy = g_slist_copy (list_b); | ||
204 | + if (copy) | ||
205 | + { | ||
206 | + GSList *iter; | ||
207 | + | ||
208 | + iter = copy; | ||
209 | + while (iter != NULL) | ||
210 | + { | ||
211 | + g_object_ref (iter->data); | ||
212 | + iter = g_slist_next (iter); | ||
213 | + } | ||
214 | + | ||
215 | + return g_slist_concat (list_a, copy); | ||
216 | + } | ||
217 | + else | ||
218 | + return list_a; | ||
219 | +} | ||
220 | + | ||
221 | /* Reuses or frees rc_styles */ | ||
222 | static GtkStyle * | ||
223 | gtk_rc_init_style (GtkRcContext *context, | ||
224 | @@ -2083,6 +2157,7 @@ | ||
225 | GtkRcStyle *base_style = NULL; | ||
226 | GtkRcStyle *proto_style; | ||
227 | GtkRcStyleClass *proto_style_class; | ||
228 | + GtkRcStylePrivate *proto_priv; | ||
229 | GSList *tmp_styles; | ||
230 | GType rc_style_type = GTK_TYPE_RC_STYLE; | ||
231 | |||
232 | @@ -2109,12 +2184,13 @@ | ||
233 | |||
234 | proto_style_class = GTK_RC_STYLE_GET_CLASS (base_style); | ||
235 | proto_style = proto_style_class->create_rc_style (base_style); | ||
236 | + proto_priv = GTK_RC_STYLE_GET_PRIVATE (proto_style); | ||
237 | |||
238 | tmp_styles = rc_styles; | ||
239 | while (tmp_styles) | ||
240 | { | ||
241 | GtkRcStyle *rc_style = tmp_styles->data; | ||
242 | - GSList *factories; | ||
243 | + GtkRcStylePrivate *rc_priv = GTK_RC_STYLE_GET_PRIVATE (rc_style); | ||
244 | |||
245 | proto_style_class->merge (proto_style, rc_style); | ||
246 | |||
247 | @@ -2122,22 +2198,12 @@ | ||
248 | if (!g_slist_find (rc_style->rc_style_lists, rc_styles)) | ||
249 | rc_style->rc_style_lists = g_slist_prepend (rc_style->rc_style_lists, rc_styles); | ||
250 | |||
251 | - factories = g_slist_copy (rc_style->icon_factories); | ||
252 | - if (factories) | ||
253 | - { | ||
254 | - GSList *iter; | ||
255 | - | ||
256 | - iter = factories; | ||
257 | - while (iter != NULL) | ||
258 | - { | ||
259 | - g_object_ref (iter->data); | ||
260 | - iter = g_slist_next (iter); | ||
261 | - } | ||
262 | - | ||
263 | - proto_style->icon_factories = g_slist_concat (proto_style->icon_factories, | ||
264 | - factories); | ||
265 | - | ||
266 | - } | ||
267 | + proto_style->icon_factories = | ||
268 | + concat_object_lists (proto_style->icon_factories, | ||
269 | + rc_style->icon_factories); | ||
270 | + proto_priv->logical_color_hashes = | ||
271 | + concat_object_lists (proto_priv->logical_color_hashes, | ||
272 | + rc_priv->logical_color_hashes); | ||
273 | |||
274 | tmp_styles = tmp_styles->next; | ||
275 | } | ||
276 | @@ -2515,9 +2581,11 @@ | ||
277 | GtkRcStyle *rc_style; | ||
278 | GtkRcStyle *orig_style; | ||
279 | GtkRcStyle *parent_style; | ||
280 | + GtkRcStylePrivate *rc_priv = NULL; | ||
281 | guint token; | ||
282 | gint i; | ||
283 | GtkIconFactory *our_factory = NULL; | ||
284 | + GtkHashTable *our_hash = NULL; | ||
285 | |||
286 | token = g_scanner_get_next_token (scanner); | ||
287 | if (token != GTK_RC_TOKEN_STYLE) | ||
288 | @@ -2533,12 +2601,6 @@ | ||
289 | else | ||
290 | orig_style = NULL; | ||
291 | |||
292 | - /* If there's a list, its first member is always the factory belonging | ||
293 | - * to this RcStyle | ||
294 | - */ | ||
295 | - if (rc_style && rc_style->icon_factories) | ||
296 | - our_factory = rc_style->icon_factories->data; | ||
297 | - | ||
298 | if (!rc_style) | ||
299 | { | ||
300 | rc_style = gtk_rc_style_new (); | ||
301 | @@ -2550,6 +2612,16 @@ | ||
302 | for (i = 0; i < 5; i++) | ||
303 | rc_style->color_flags[i] = 0; | ||
304 | } | ||
305 | + | ||
306 | + rc_priv = GTK_RC_STYLE_GET_PRIVATE (rc_style); | ||
307 | + | ||
308 | + /* If there's a list, its first member is always the factory belonging | ||
309 | + * to this RcStyle | ||
310 | + */ | ||
311 | + if (rc_style->icon_factories) | ||
312 | + our_factory = rc_style->icon_factories->data; | ||
313 | + if (rc_priv->logical_color_hashes) | ||
314 | + our_hash = rc_priv->logical_color_hashes->data; | ||
315 | |||
316 | token = g_scanner_peek_next_token (scanner); | ||
317 | if (token == G_TOKEN_EQUAL_SIGN) | ||
318 | @@ -2566,8 +2638,8 @@ | ||
319 | parent_style = gtk_rc_style_find (context, scanner->value.v_string); | ||
320 | if (parent_style) | ||
321 | { | ||
322 | - GSList *factories; | ||
323 | - | ||
324 | + GtkRcStylePrivate *parent_priv = GTK_RC_STYLE_GET_PRIVATE (parent_style); | ||
325 | + | ||
326 | for (i = 0; i < 5; i++) | ||
327 | { | ||
328 | rc_style->color_flags[i] = parent_style->color_flags[i]; | ||
329 | @@ -2621,17 +2693,24 @@ | ||
330 | rc_style->icon_factories = g_slist_prepend (rc_style->icon_factories, | ||
331 | our_factory); | ||
332 | } | ||
333 | - | ||
334 | - rc_style->icon_factories = g_slist_concat (rc_style->icon_factories, | ||
335 | - g_slist_copy (parent_style->icon_factories)); | ||
336 | - | ||
337 | - factories = parent_style->icon_factories; | ||
338 | - while (factories != NULL) | ||
339 | + rc_style->icon_factories = concat_object_lists (rc_style->icon_factories, | ||
340 | + parent_style->icon_factories); | ||
341 | + } | ||
342 | + | ||
343 | + /* Also append parent's color hashes, adding a ref to them */ | ||
344 | + if (parent_priv->logical_color_hashes != NULL) | ||
345 | + { | ||
346 | + /* See comment above .. */ | ||
347 | + if (our_hash == NULL) | ||
348 | { | ||
349 | - g_object_ref (factories->data); | ||
350 | - factories = factories->next; | ||
351 | + our_hash = _gtk_hash_table_new (); | ||
352 | + rc_priv->logical_color_hashes = g_slist_prepend (rc_priv->logical_color_hashes, | ||
353 | + our_hash); | ||
354 | } | ||
355 | - } | ||
356 | + | ||
357 | + rc_priv->logical_color_hashes = concat_object_lists (rc_priv->logical_color_hashes, | ||
358 | + parent_priv->logical_color_hashes); | ||
359 | + } | ||
360 | } | ||
361 | } | ||
362 | |||
363 | @@ -2689,12 +2768,22 @@ | ||
364 | } | ||
365 | token = gtk_rc_parse_stock (context, scanner, rc_style, our_factory); | ||
366 | break; | ||
367 | + case GTK_RC_TOKEN_LOGICAL_COLOR: | ||
368 | + if (our_hash == NULL) | ||
369 | + { | ||
370 | + our_hash = _gtk_hash_table_new (); | ||
371 | + rc_priv->logical_color_hashes = g_slist_prepend (rc_priv->logical_color_hashes, | ||
372 | + our_hash); | ||
373 | + } | ||
374 | + token = gtk_rc_parse_logical_color (scanner, rc_style, our_hash); | ||
375 | + break; | ||
376 | case G_TOKEN_IDENTIFIER: | ||
377 | if (is_c_identifier (scanner->next_value.v_identifier) && | ||
378 | scanner->next_value.v_identifier[0] >= 'A' && | ||
379 | scanner->next_value.v_identifier[0] <= 'Z') /* match namespaced type names */ | ||
380 | { | ||
381 | GtkRcProperty prop = { 0, 0, NULL, { 0, }, }; | ||
382 | + gchar *name; | ||
383 | |||
384 | g_scanner_get_next_token (scanner); /* eat type name */ | ||
385 | prop.type_name = g_quark_from_string (scanner->value.v_identifier); | ||
386 | @@ -2712,8 +2801,10 @@ | ||
387 | } | ||
388 | |||
389 | /* it's important that we do the same canonification as GParamSpecPool here */ | ||
390 | - g_strcanon (scanner->value.v_identifier, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-'); | ||
391 | - prop.property_name = g_quark_from_string (scanner->value.v_identifier); | ||
392 | + name = g_strdup (scanner->value.v_identifier); | ||
393 | + g_strcanon (name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-'); | ||
394 | + prop.property_name = g_quark_from_string (name); | ||
395 | + g_free (name); | ||
396 | |||
397 | token = gtk_rc_parse_assignment (scanner, &prop); | ||
398 | if (token == G_TOKEN_NONE) | ||
399 | @@ -2825,7 +2916,7 @@ | ||
400 | return G_TOKEN_EQUAL_SIGN; | ||
401 | |||
402 | style->color_flags[state] |= GTK_RC_BG; | ||
403 | - return gtk_rc_parse_color (scanner, &style->bg[state]); | ||
404 | + return gtk_rc_parse_color_full (scanner, &style->bg[state], style); | ||
405 | } | ||
406 | |||
407 | static guint | ||
408 | @@ -2848,7 +2939,7 @@ | ||
409 | return G_TOKEN_EQUAL_SIGN; | ||
410 | |||
411 | style->color_flags[state] |= GTK_RC_FG; | ||
412 | - return gtk_rc_parse_color (scanner, &style->fg[state]); | ||
413 | + return gtk_rc_parse_color_full (scanner, &style->fg[state], style); | ||
414 | } | ||
415 | |||
416 | static guint | ||
417 | @@ -2871,7 +2962,7 @@ | ||
418 | return G_TOKEN_EQUAL_SIGN; | ||
419 | |||
420 | style->color_flags[state] |= GTK_RC_TEXT; | ||
421 | - return gtk_rc_parse_color (scanner, &style->text[state]); | ||
422 | + return gtk_rc_parse_color_full (scanner, &style->text[state], style); | ||
423 | } | ||
424 | |||
425 | static guint | ||
426 | @@ -2894,7 +2985,7 @@ | ||
427 | return G_TOKEN_EQUAL_SIGN; | ||
428 | |||
429 | style->color_flags[state] |= GTK_RC_BASE; | ||
430 | - return gtk_rc_parse_color (scanner, &style->base[state]); | ||
431 | + return gtk_rc_parse_color_full (scanner, &style->base[state], style); | ||
432 | } | ||
433 | |||
434 | static guint | ||
435 | @@ -3345,11 +3436,45 @@ | ||
436 | |||
437 | return G_TOKEN_NONE; | ||
438 | } | ||
439 | +static gboolean | ||
440 | +lookup_logical_color (GtkRcStyle *style, | ||
441 | + const char *color_name, | ||
442 | + GdkColor *color) | ||
443 | +{ | ||
444 | + GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (style); | ||
445 | + GSList *iter; | ||
446 | + | ||
447 | + iter = priv->logical_color_hashes; | ||
448 | + while (iter != NULL) | ||
449 | + { | ||
450 | + GdkColor *match = g_hash_table_lookup (GTK_HASH_TABLE (iter->data)->hash, | ||
451 | + color_name); | ||
452 | + if (match) | ||
453 | + { | ||
454 | + color->red = match->red; | ||
455 | + color->green = match->green; | ||
456 | + color->blue = match->blue; | ||
457 | + return TRUE; | ||
458 | + } | ||
459 | + | ||
460 | + iter = g_slist_next (iter); | ||
461 | + } | ||
462 | + | ||
463 | + return FALSE; | ||
464 | +} | ||
465 | |||
466 | guint | ||
467 | gtk_rc_parse_color (GScanner *scanner, | ||
468 | GdkColor *color) | ||
469 | { | ||
470 | + return gtk_rc_parse_color_full (scanner, color, NULL); | ||
471 | +} | ||
472 | + | ||
473 | +static guint | ||
474 | +gtk_rc_parse_color_full (GScanner *scanner, | ||
475 | + GdkColor *color, | ||
476 | + GtkRcStyle *style) | ||
477 | +{ | ||
478 | guint token; | ||
479 | |||
480 | g_return_val_if_fail (scanner != NULL, G_TOKEN_ERROR); | ||
481 | @@ -3407,11 +3532,14 @@ | ||
482 | case G_TOKEN_STRING: | ||
483 | if (!gdk_color_parse (scanner->value.v_string, color)) | ||
484 | { | ||
485 | - g_scanner_warn (scanner, "Invalid color constant '%s'", | ||
486 | - scanner->value.v_string); | ||
487 | - return G_TOKEN_STRING; | ||
488 | + if (!(style && lookup_logical_color (style, scanner->value.v_string, color))) | ||
489 | + { | ||
490 | + g_scanner_warn (scanner, "Invalid color constant '%s'", | ||
491 | + scanner->value.v_string); | ||
492 | + return G_TOKEN_STRING; | ||
493 | + } | ||
494 | } | ||
495 | - else | ||
496 | + | ||
497 | return G_TOKEN_NONE; | ||
498 | |||
499 | default: | ||
500 | @@ -3625,8 +3753,8 @@ | ||
501 | } | ||
502 | |||
503 | static guint | ||
504 | -gtk_rc_parse_stock_id (GScanner *scanner, | ||
505 | - gchar **stock_id) | ||
506 | +gtk_rc_parse_hash_key (GScanner *scanner, | ||
507 | + gchar **hash_key) | ||
508 | { | ||
509 | guint token; | ||
510 | |||
511 | @@ -3639,12 +3767,12 @@ | ||
512 | if (token != G_TOKEN_STRING) | ||
513 | return G_TOKEN_STRING; | ||
514 | |||
515 | - *stock_id = g_strdup (scanner->value.v_string); | ||
516 | + *hash_key = g_strdup (scanner->value.v_string); | ||
517 | |||
518 | token = g_scanner_get_next_token (scanner); | ||
519 | if (token != G_TOKEN_RIGHT_BRACE) | ||
520 | { | ||
521 | - g_free (*stock_id); | ||
522 | + g_free (*hash_key); | ||
523 | return G_TOKEN_RIGHT_BRACE; | ||
524 | } | ||
525 | |||
526 | @@ -3854,7 +3982,7 @@ | ||
527 | if (token != GTK_RC_TOKEN_STOCK) | ||
528 | return GTK_RC_TOKEN_STOCK; | ||
529 | |||
530 | - token = gtk_rc_parse_stock_id (scanner, &stock_id); | ||
531 | + token = gtk_rc_parse_hash_key (scanner, &stock_id); | ||
532 | if (token != G_TOKEN_NONE) | ||
533 | return token; | ||
534 | |||
535 | @@ -3965,3 +4093,46 @@ | ||
536 | } | ||
537 | |||
538 | #endif | ||
539 | + | ||
540 | +static guint | ||
541 | +gtk_rc_parse_logical_color (GScanner *scanner, | ||
542 | + GtkRcStyle *rc_style, | ||
543 | + GtkHashTable *hash) | ||
544 | +{ | ||
545 | + gchar *color_id = NULL; | ||
546 | + guint token; | ||
547 | + GdkColor *color; | ||
548 | + | ||
549 | + token = g_scanner_get_next_token (scanner); | ||
550 | + if (token != GTK_RC_TOKEN_LOGICAL_COLOR) | ||
551 | + return GTK_RC_TOKEN_LOGICAL_COLOR; | ||
552 | + | ||
553 | + token = gtk_rc_parse_hash_key (scanner, &color_id); | ||
554 | + if (token != G_TOKEN_NONE) | ||
555 | + return token; | ||
556 | + | ||
557 | + token = g_scanner_get_next_token (scanner); | ||
558 | + if (token != G_TOKEN_EQUAL_SIGN) | ||
559 | + { | ||
560 | + g_free (color_id); | ||
561 | + return G_TOKEN_EQUAL_SIGN; | ||
562 | + } | ||
563 | + | ||
564 | + color = g_new (GdkColor, 1); | ||
565 | + token = gtk_rc_parse_color_full (scanner, color, rc_style); | ||
566 | + if (token != G_TOKEN_NONE) | ||
567 | + { | ||
568 | + g_free (color_id); | ||
569 | + g_free (color); | ||
570 | + return token; | ||
571 | + } | ||
572 | + | ||
573 | + /* Because the hash is created with destroy functions, | ||
574 | + * g_hash_table_insert will free any old values for us, | ||
575 | + * if a mapping with the specified key already exists. */ | ||
576 | + g_hash_table_insert (hash->hash, color_id, color); | ||
577 | + | ||
578 | + return G_TOKEN_NONE; | ||
579 | +} | ||
580 | + | ||
581 | + | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrc.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrc.h.diff deleted file mode 100644 index 42710cd549..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkrc.h.diff +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkrc.h 2004-12-12 23:09:13.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkrc.h 2005-04-06 16:19:37.866781736 +0300 | ||
3 | @@ -211,6 +211,7 @@ | ||
4 | GTK_RC_TOKEN_STOCK, | ||
5 | GTK_RC_TOKEN_LTR, | ||
6 | GTK_RC_TOKEN_RTL, | ||
7 | + GTK_RC_TOKEN_LOGICAL_COLOR, | ||
8 | GTK_RC_TOKEN_LAST | ||
9 | } GtkRcTokenType; | ||
10 | |||
11 | @@ -241,6 +242,8 @@ | ||
12 | |||
13 | const gchar* _gtk_rc_context_get_default_font_name (GtkSettings *settings); | ||
14 | |||
15 | +GSList *_gtk_rc_style_get_logical_color_hashes (GtkRcStyle *rc_style); | ||
16 | + | ||
17 | #ifdef __cplusplus | ||
18 | } | ||
19 | #endif /* __cplusplus */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkscrolledwindow.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkscrolledwindow.c.diff deleted file mode 100644 index 3c20de8ebd..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkscrolledwindow.c.diff +++ /dev/null | |||
@@ -1,162 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkscrolledwindow.c 2004-08-09 19:59:52.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkscrolledwindow.c 2005-04-06 16:19:37.898776872 +0300 | ||
3 | @@ -289,6 +289,13 @@ | ||
4 | DEFAULT_SCROLLBAR_SPACING, | ||
5 | G_PARAM_READABLE)); | ||
6 | |||
7 | + gtk_widget_class_install_style_property (widget_class, | ||
8 | + g_param_spec_boolean ("scrollbar_dislocation", | ||
9 | + P_("Scrollbar dislocation"), | ||
10 | + P_("Flag for having scrollbar at the outer border or container padding instead of at the inner border"), | ||
11 | + FALSE, | ||
12 | + G_PARAM_READABLE)); | ||
13 | + | ||
14 | signals[SCROLL_CHILD] = | ||
15 | g_signal_new ("scroll_child", | ||
16 | G_TYPE_FROM_CLASS (object_class), | ||
17 | @@ -1062,6 +1069,73 @@ | ||
18 | } | ||
19 | } | ||
20 | |||
21 | +static gdouble | ||
22 | +gtk_scrolled_window_get_focus_movement (GtkScrolledWindow *scrolled_window) | ||
23 | +{ | ||
24 | + GtkWidget *focus_child; | ||
25 | + GtkRange *range; | ||
26 | + GtkAdjustment *adj; | ||
27 | + gdouble value, new_value; | ||
28 | + gint x, y; | ||
29 | + | ||
30 | + focus_child = GTK_CONTAINER(scrolled_window)->focus_child; | ||
31 | + if (focus_child == NULL) | ||
32 | + return 0; | ||
33 | + | ||
34 | + while (GTK_IS_CONTAINER (focus_child) && | ||
35 | + GTK_CONTAINER (focus_child)->focus_child) | ||
36 | + { | ||
37 | + focus_child = GTK_CONTAINER (focus_child)->focus_child; | ||
38 | + } | ||
39 | + | ||
40 | + range = GTK_RANGE (scrolled_window->vscrollbar); | ||
41 | + adj = range->adjustment; | ||
42 | + value = gtk_adjustment_get_value (adj); | ||
43 | + | ||
44 | + gtk_widget_translate_coordinates (focus_child->parent, | ||
45 | + GTK_WIDGET(scrolled_window), | ||
46 | + focus_child->allocation.x, | ||
47 | + focus_child->allocation.y, &x, &y); | ||
48 | + | ||
49 | + if (y < 0) | ||
50 | + { | ||
51 | + /* scroll up */ | ||
52 | + new_value = value + y; | ||
53 | + if (new_value < adj->lower) | ||
54 | + new_value = adj->lower; | ||
55 | + } | ||
56 | + else if (y + focus_child->allocation.height > adj->page_size) | ||
57 | + { | ||
58 | + /* scroll down */ | ||
59 | + new_value = value + y + focus_child->allocation.height - adj->page_size; | ||
60 | + if (new_value > adj->upper - adj->page_size) | ||
61 | + new_value = adj->upper - adj->page_size; | ||
62 | + } | ||
63 | + else | ||
64 | + { | ||
65 | + new_value = value; | ||
66 | + } | ||
67 | + | ||
68 | + return new_value - value; | ||
69 | +} | ||
70 | + | ||
71 | +static void | ||
72 | +gtk_scrolled_window_scroll_to_focus (GtkScrolledWindow *scrolled_window) | ||
73 | +{ | ||
74 | + GtkAdjustment *adj; | ||
75 | + gdouble diff; | ||
76 | + | ||
77 | + diff = gtk_scrolled_window_get_focus_movement (scrolled_window); | ||
78 | + if (diff != 0) | ||
79 | + { | ||
80 | + adj = GTK_RANGE (scrolled_window->vscrollbar)->adjustment; | ||
81 | + | ||
82 | + gtk_adjustment_set_value (adj, gtk_adjustment_get_value (adj) + diff); | ||
83 | + gtk_scrolled_window_set_vadjustment (scrolled_window, | ||
84 | + GTK_ADJUSTMENT (adj)); | ||
85 | + } | ||
86 | +} | ||
87 | + | ||
88 | static void | ||
89 | gtk_scrolled_window_size_allocate (GtkWidget *widget, | ||
90 | GtkAllocation *allocation) | ||
91 | @@ -1071,17 +1145,32 @@ | ||
92 | GtkAllocation relative_allocation; | ||
93 | GtkAllocation child_allocation; | ||
94 | gint scrollbar_spacing; | ||
95 | - | ||
96 | + gboolean is_focus_visible, dislocate; | ||
97 | + gint dislocation; | ||
98 | + | ||
99 | g_return_if_fail (GTK_IS_SCROLLED_WINDOW (widget)); | ||
100 | g_return_if_fail (allocation != NULL); | ||
101 | |||
102 | scrolled_window = GTK_SCROLLED_WINDOW (widget); | ||
103 | bin = GTK_BIN (scrolled_window); | ||
104 | |||
105 | + is_focus_visible = | ||
106 | + gtk_scrolled_window_get_focus_movement (scrolled_window) == 0; | ||
107 | + | ||
108 | scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window); | ||
109 | |||
110 | widget->allocation = *allocation; | ||
111 | |||
112 | + /* See how much scrollbar needs be "dislocated" (to get it to the other | ||
113 | + * edge of the border). Does not apply to all occasions. */ | ||
114 | + gtk_widget_style_get (GTK_WIDGET (scrolled_window), | ||
115 | + "scrollbar_dislocation", &dislocate, | ||
116 | + NULL); | ||
117 | + if (dislocate) | ||
118 | + dislocation = GTK_CONTAINER (scrolled_window)->border_width; | ||
119 | + else | ||
120 | + dislocation = 0; | ||
121 | + | ||
122 | if (scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS) | ||
123 | scrolled_window->hscrollbar_visible = TRUE; | ||
124 | else if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER) | ||
125 | @@ -1150,10 +1239,12 @@ | ||
126 | child_allocation.y = (relative_allocation.y + | ||
127 | relative_allocation.height + | ||
128 | scrollbar_spacing + | ||
129 | + dislocation + | ||
130 | (scrolled_window->shadow_type == GTK_SHADOW_NONE ? | ||
131 | 0 : widget->style->ythickness)); | ||
132 | else | ||
133 | - child_allocation.y = GTK_CONTAINER (scrolled_window)->border_width; | ||
134 | + child_allocation.y = GTK_CONTAINER (scrolled_window)->border_width - | ||
135 | + dislocation; | ||
136 | |||
137 | child_allocation.width = relative_allocation.width; | ||
138 | child_allocation.height = hscrollbar_requisition.height; | ||
139 | @@ -1189,10 +1280,12 @@ | ||
140 | child_allocation.x = (relative_allocation.x + | ||
141 | relative_allocation.width + | ||
142 | scrollbar_spacing + | ||
143 | + dislocation + | ||
144 | (scrolled_window->shadow_type == GTK_SHADOW_NONE ? | ||
145 | 0 : widget->style->xthickness)); | ||
146 | else | ||
147 | - child_allocation.x = GTK_CONTAINER (scrolled_window)->border_width; | ||
148 | + child_allocation.x = GTK_CONTAINER (scrolled_window)->border_width - | ||
149 | + dislocation; | ||
150 | |||
151 | child_allocation.y = relative_allocation.y; | ||
152 | child_allocation.width = vscrollbar_requisition.width; | ||
153 | @@ -1207,6 +1300,9 @@ | ||
154 | } | ||
155 | |||
156 | gtk_widget_size_allocate (scrolled_window->vscrollbar, &child_allocation); | ||
157 | + | ||
158 | + if (is_focus_visible) | ||
159 | + gtk_scrolled_window_scroll_to_focus (scrolled_window); | ||
160 | } | ||
161 | else if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar)) | ||
162 | gtk_widget_hide (scrolled_window->vscrollbar); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkseparator.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkseparator.c.diff deleted file mode 100644 index 63810e047b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkseparator.c.diff +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkseparator.c 2004-08-09 19:59:52.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkseparator.c 2005-04-06 16:19:37.928772312 +0300 | ||
3 | @@ -65,6 +65,18 @@ | ||
4 | static void | ||
5 | gtk_separator_class_init (GtkSeparatorClass *class) | ||
6 | { | ||
7 | + GParamSpec* pspec; | ||
8 | + | ||
9 | + pspec = g_param_spec_boolean("hildonlike-drawing", | ||
10 | + "hildonlike looks.", | ||
11 | + "hildonlike looks. " | ||
12 | + "Draws with paint_box " | ||
13 | + "instead of paint_(vh)line, 1/0", | ||
14 | + FALSE, | ||
15 | + G_PARAM_READABLE); | ||
16 | + | ||
17 | + gtk_widget_class_install_style_property(GTK_WIDGET_CLASS(class), | ||
18 | + pspec); | ||
19 | } | ||
20 | |||
21 | static void | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkseparatortoolitem.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkseparatortoolitem.c.diff deleted file mode 100644 index 63203f7db6..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkseparatortoolitem.c.diff +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkseparatortoolitem.c 2004-08-09 19:59:52.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkseparatortoolitem.c 2005-04-06 16:19:37.937770944 +0300 | ||
3 | @@ -29,6 +29,7 @@ | ||
4 | #include "gtktoolbar.h" | ||
5 | |||
6 | #define MENU_ID "gtk-separator-tool-item-menu-id" | ||
7 | +#define HILDON_SEPARATOR_HEIGHT 40 | ||
8 | |||
9 | enum { | ||
10 | PROP_0, | ||
11 | @@ -137,6 +138,18 @@ | ||
12 | P_("Whether the separator is drawn, or just blank"), | ||
13 | TRUE, | ||
14 | G_PARAM_READWRITE)); | ||
15 | + /* Hildon addition : some new style properties we need. */ | ||
16 | + gtk_widget_class_install_style_property(widget_class, | ||
17 | + g_param_spec_int ("separator_size", | ||
18 | + P_("Separator size"), P_("The thickness of the separator. -1 for default behaviour."), | ||
19 | + -1, G_MAXINT, -1, G_PARAM_READWRITE)); | ||
20 | + | ||
21 | + gtk_widget_class_install_style_property (widget_class, | ||
22 | + g_param_spec_boolean ("is_image", | ||
23 | + P_("Is separator an image or a line"), | ||
24 | + P_("Whether the separator is drawn as an image, or just as a line"), | ||
25 | + FALSE, | ||
26 | + G_PARAM_READWRITE)); | ||
27 | |||
28 | g_type_class_add_private (object_class, sizeof (GtkSeparatorToolItemPrivate)); | ||
29 | } | ||
30 | @@ -213,14 +226,26 @@ | ||
31 | GtkToolItem *item = GTK_TOOL_ITEM (widget); | ||
32 | GtkOrientation orientation = gtk_tool_item_get_orientation (item); | ||
33 | |||
34 | + /* Hildon modifications from here on: | ||
35 | + * if the "separator_size" style property | ||
36 | + * is the default value (it has not been set | ||
37 | + * in resource files), use default gtk+ behaviour. | ||
38 | + */ | ||
39 | + gint separator_size = -1; | ||
40 | + | ||
41 | + gtk_widget_style_get( widget, "separator_size", &separator_size, NULL ); | ||
42 | + | ||
43 | + if (separator_size == -1) | ||
44 | + separator_size = get_space_size (item); | ||
45 | + | ||
46 | if (orientation == GTK_ORIENTATION_HORIZONTAL) | ||
47 | { | ||
48 | - requisition->width = get_space_size (item); | ||
49 | + requisition->width = separator_size; | ||
50 | requisition->height = 1; | ||
51 | } | ||
52 | else | ||
53 | { | ||
54 | - requisition->height = get_space_size (item); | ||
55 | + requisition->height = separator_size; | ||
56 | requisition->width = 1; | ||
57 | } | ||
58 | } | ||
59 | @@ -235,10 +260,30 @@ | ||
60 | |||
61 | if (priv->draw) | ||
62 | { | ||
63 | + gboolean is_image = FALSE; | ||
64 | if (widget->parent && GTK_IS_TOOLBAR (widget->parent)) | ||
65 | toolbar = GTK_TOOLBAR (widget->parent); | ||
66 | |||
67 | - _gtk_toolbar_paint_space_line (widget, toolbar, | ||
68 | + gtk_widget_style_get( widget, "is_image", &is_image, NULL ); | ||
69 | + if (is_image) | ||
70 | + { | ||
71 | + gint separator_size = -1; | ||
72 | + GtkOrientation orientation = gtk_tool_item_get_orientation (GTK_TOOL_ITEM (widget)); | ||
73 | + | ||
74 | + gtk_widget_style_get( widget, "separator_size", &separator_size, NULL ); | ||
75 | + | ||
76 | + /* if style property not set, use gtk+ | ||
77 | + * default behaviour. */ | ||
78 | + if (separator_size == -1) | ||
79 | + separator_size = get_space_size (GTK_TOOL_ITEM (widget)); | ||
80 | + | ||
81 | + gtk_paint_box( widget->style, widget->window, GTK_WIDGET_STATE(widget), | ||
82 | + GTK_SHADOW_NONE, &event->area, widget, | ||
83 | + orientation == GTK_ORIENTATION_HORIZONTAL ? "vertical" : "horizontal", | ||
84 | + widget->allocation.x, widget->allocation.y + (widget->allocation.height - HILDON_SEPARATOR_HEIGHT) / 2, | ||
85 | + separator_size, HILDON_SEPARATOR_HEIGHT ); | ||
86 | + } else | ||
87 | + _gtk_toolbar_paint_space_line (widget, toolbar, | ||
88 | &(event->area), &widget->allocation); | ||
89 | } | ||
90 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtksettings.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtksettings.c.diff deleted file mode 100644 index fac467797d..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtksettings.c.diff +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtksettings.c 2004-11-20 01:18:38.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtksettings.c 2005-04-06 16:19:37.941770336 +0300 | ||
3 | @@ -1,4 +1,4 @@ | ||
4 | -/* GTK - The GIMP Toolkit | ||
5 | +/* | ||
6 | * Copyright (C) 2000 Red Hat, Inc. | ||
7 | * | ||
8 | * This library is free software; you can redistribute it and/or | ||
9 | @@ -24,6 +24,9 @@ | ||
10 | #include "gtkintl.h" | ||
11 | #include "gtkwidget.h" | ||
12 | |||
13 | +#define DEFAULT_INITIAL_TIMEOUT 300 | ||
14 | +#define DEFAULT_UPDATE_TIMEOUT 125 | ||
15 | + | ||
16 | typedef struct _GtkSettingsValuePrivate GtkSettingsValuePrivate; | ||
17 | |||
18 | typedef enum | ||
19 | @@ -72,6 +75,9 @@ | ||
20 | PROP_XFT_RGBA, | ||
21 | PROP_XFT_DPI, | ||
22 | #endif | ||
23 | + PROP_INITIAL_TIMEOUT, | ||
24 | + PROP_UPDATE_TIMEOUT, | ||
25 | + PROP_HILDON_KEYBOARD_NAVIGATION, | ||
26 | PROP_ALTERNATIVE_BUTTON_ORDER | ||
27 | }; | ||
28 | |||
29 | @@ -426,6 +432,37 @@ | ||
30 | NULL); | ||
31 | |||
32 | g_assert (result == PROP_XFT_DPI); | ||
33 | + | ||
34 | + result = settings_install_property_parser (class, | ||
35 | + g_param_spec_int ("gtk-initial-timeout", | ||
36 | + P_("Start timeout"), | ||
37 | + P_("Starting value for timeouts, when button is pressed"), | ||
38 | + 0, G_MAXINT, DEFAULT_INITIAL_TIMEOUT, | ||
39 | + G_PARAM_READWRITE), | ||
40 | + NULL); | ||
41 | + | ||
42 | + g_assert (result == PROP_INITIAL_TIMEOUT); | ||
43 | + | ||
44 | + result = settings_install_property_parser (class, | ||
45 | + g_param_spec_int ("gtk-update-timeout", | ||
46 | + P_("Repeat timeout"), | ||
47 | + P_("Repeat value for timeouts, when button is pressed"), | ||
48 | + 0, G_MAXINT, DEFAULT_UPDATE_TIMEOUT, | ||
49 | + G_PARAM_READWRITE), | ||
50 | + NULL); | ||
51 | + | ||
52 | + g_assert (result == PROP_UPDATE_TIMEOUT); | ||
53 | + | ||
54 | + result = settings_install_property_parser (class, | ||
55 | + g_param_spec_boolean ("hildon-keyboard-navigation", | ||
56 | + P_("Keyboard navigation"), | ||
57 | + P_("This property can be used to enable keyboard navigation"), | ||
58 | + FALSE, | ||
59 | + G_PARAM_READWRITE), | ||
60 | + NULL); | ||
61 | + | ||
62 | + g_assert (result == PROP_HILDON_KEYBOARD_NAVIGATION); | ||
63 | + | ||
64 | #endif /* GDK_WINDOWING_X11 */ | ||
65 | result = settings_install_property_parser (class, | ||
66 | g_param_spec_boolean ("gtk-alternative-button-order", | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkspinbutton.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkspinbutton.c.diff deleted file mode 100644 index 13f8c330f5..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkspinbutton.c.diff +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkspinbutton.c 2004-11-14 03:25:35.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkspinbutton.c 2005-04-06 16:19:37.945769728 +0300 | ||
3 | @@ -1041,15 +1041,21 @@ | ||
4 | GtkArrowType click_child, | ||
5 | gdouble step) | ||
6 | { | ||
7 | + GtkSettings *settings; | ||
8 | + guint timeout; | ||
9 | + | ||
10 | g_return_if_fail (click_child == GTK_ARROW_UP || click_child == GTK_ARROW_DOWN); | ||
11 | - | ||
12 | + | ||
13 | + settings = gtk_settings_get_default (); | ||
14 | + g_object_get (settings, "gtk-initial-timeout", &timeout, NULL); | ||
15 | + | ||
16 | spin->click_child = click_child; | ||
17 | |||
18 | if (!spin->timer) | ||
19 | { | ||
20 | spin->timer_step = step; | ||
21 | spin->need_timer = TRUE; | ||
22 | - spin->timer = g_timeout_add (SPIN_BUTTON_INITIAL_TIMER_DELAY, | ||
23 | + spin->timer = g_timeout_add (/*SPIN_BUTTON_INITIAL_TIMER_DELAY*/timeout, | ||
24 | (GSourceFunc) gtk_spin_button_timer, | ||
25 | (gpointer) spin); | ||
26 | } | ||
27 | @@ -1188,9 +1194,14 @@ | ||
28 | gtk_spin_button_timer (GtkSpinButton *spin_button) | ||
29 | { | ||
30 | gboolean retval = FALSE; | ||
31 | + GtkSettings *settings; | ||
32 | + guint timeout; | ||
33 | |||
34 | GDK_THREADS_ENTER (); | ||
35 | |||
36 | + settings = gtk_settings_get_default (); | ||
37 | + g_object_get (settings, "gtk-update-timeout", &timeout, NULL); | ||
38 | + | ||
39 | if (spin_button->timer) | ||
40 | { | ||
41 | if (spin_button->click_child == GTK_ARROW_UP) | ||
42 | @@ -1201,7 +1212,7 @@ | ||
43 | if (spin_button->need_timer) | ||
44 | { | ||
45 | spin_button->need_timer = FALSE; | ||
46 | - spin_button->timer = g_timeout_add (SPIN_BUTTON_TIMER_DELAY, | ||
47 | + spin_button->timer = g_timeout_add (/*SPIN_BUTTON_TIMER_DELAY*/timeout, | ||
48 | (GSourceFunc) gtk_spin_button_timer, | ||
49 | (gpointer) spin_button); | ||
50 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkstyle.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkstyle.c.diff deleted file mode 100644 index 6a94d96509..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkstyle.c.diff +++ /dev/null | |||
@@ -1,250 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkstyle.c 2005-01-18 18:43:45.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkstyle.c 2005-04-06 16:19:37.951768816 +0300 | ||
3 | @@ -38,6 +38,7 @@ | ||
4 | #include "gtkthemes.h" | ||
5 | #include "gtkiconfactory.h" | ||
6 | #include "gtksettings.h" /* _gtk_settings_parse_convert() */ | ||
7 | +#include "gtkhashtable.h" | ||
8 | |||
9 | #define LIGHTNESS_MULT 1.3 | ||
10 | #define DARKNESS_MULT 0.7 | ||
11 | @@ -49,6 +50,14 @@ | ||
12 | GValue value; | ||
13 | } PropertyValue; | ||
14 | |||
15 | +#define GTK_STYLE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_STYLE, GtkStylePrivate)) | ||
16 | + | ||
17 | +typedef struct _GtkStylePrivate GtkStylePrivate; | ||
18 | + | ||
19 | +struct _GtkStylePrivate { | ||
20 | + GSList *logical_color_hashes; | ||
21 | +}; | ||
22 | + | ||
23 | /* --- prototypes --- */ | ||
24 | static void gtk_style_init (GtkStyle *style); | ||
25 | static void gtk_style_class_init (GtkStyleClass *klass); | ||
26 | @@ -655,6 +664,7 @@ | ||
27 | klass->draw_layout = gtk_default_draw_layout; | ||
28 | klass->draw_resize_grip = gtk_default_draw_resize_grip; | ||
29 | |||
30 | + g_type_class_add_private (object_class, sizeof (GtkStylePrivate)); | ||
31 | |||
32 | /** | ||
33 | * GtkStyle::realize: | ||
34 | @@ -714,9 +724,28 @@ | ||
35 | } | ||
36 | |||
37 | static void | ||
38 | +free_object_list (GSList *list) | ||
39 | +{ | ||
40 | + if (list) | ||
41 | + { | ||
42 | + GSList *tmp_list = list; | ||
43 | + | ||
44 | + while (tmp_list) | ||
45 | + { | ||
46 | + g_object_unref (tmp_list->data); | ||
47 | + tmp_list = tmp_list->next; | ||
48 | + } | ||
49 | + | ||
50 | + g_slist_free (list); | ||
51 | + } | ||
52 | + | ||
53 | +} | ||
54 | + | ||
55 | +static void | ||
56 | gtk_style_finalize (GObject *object) | ||
57 | { | ||
58 | GtkStyle *style = GTK_STYLE (object); | ||
59 | + GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style); | ||
60 | |||
61 | g_return_if_fail (style->attach_count == 0); | ||
62 | |||
63 | @@ -745,19 +774,9 @@ | ||
64 | g_slist_free_1 (style->styles); | ||
65 | } | ||
66 | } | ||
67 | - | ||
68 | - if (style->icon_factories) | ||
69 | - { | ||
70 | - GSList *tmp_list = style->icon_factories; | ||
71 | - | ||
72 | - while (tmp_list) | ||
73 | - { | ||
74 | - g_object_unref (tmp_list->data); | ||
75 | - tmp_list = tmp_list->next; | ||
76 | - } | ||
77 | - | ||
78 | - g_slist_free (style->icon_factories); | ||
79 | - } | ||
80 | + | ||
81 | + free_object_list (style->icon_factories); | ||
82 | + free_object_list (priv->logical_color_hashes); | ||
83 | |||
84 | pango_font_description_free (style->font_desc); | ||
85 | |||
86 | @@ -1003,6 +1022,51 @@ | ||
87 | return gtk_icon_factory_lookup_default (stock_id); | ||
88 | } | ||
89 | |||
90 | + /** | ||
91 | + * gtk_style_lookup_logical_color: | ||
92 | + * @style: a #GtkStyle | ||
93 | + * @color_name: the name of the logical color to look up | ||
94 | + * @color: the #GdkColor to fill in | ||
95 | + * | ||
96 | + * Looks up @color_name in the style's logical color mappings, | ||
97 | + * filling in @color and returning %TRUE if found, otherwise | ||
98 | + * returning %FALSE. Do not cache the found mapping, because | ||
99 | + * it depends on the #GtkStyle and might change when a theme | ||
100 | + * switch occurs. | ||
101 | + * | ||
102 | + * Return value: %TRUE if the mapping was found. | ||
103 | + */ | ||
104 | +gboolean | ||
105 | +gtk_style_lookup_logical_color (GtkStyle *style, | ||
106 | + const char *color_name, | ||
107 | + GdkColor *color) | ||
108 | +{ | ||
109 | + GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style); | ||
110 | + GSList *iter; | ||
111 | + | ||
112 | + g_return_val_if_fail (GTK_IS_STYLE (style), FALSE); | ||
113 | + g_return_val_if_fail (color_name != NULL, FALSE); | ||
114 | + g_return_val_if_fail (color != NULL, FALSE); | ||
115 | + | ||
116 | + iter = priv->logical_color_hashes; | ||
117 | + while (iter != NULL) | ||
118 | + { | ||
119 | + GdkColor *mapping = g_hash_table_lookup (GTK_HASH_TABLE (iter->data)->hash, | ||
120 | + color_name); | ||
121 | + if (mapping) | ||
122 | + { | ||
123 | + color->red = mapping->red; | ||
124 | + color->green = mapping->green; | ||
125 | + color->blue = mapping->blue; | ||
126 | + return TRUE; | ||
127 | + } | ||
128 | + | ||
129 | + iter = g_slist_next (iter); | ||
130 | + } | ||
131 | + | ||
132 | + return FALSE; | ||
133 | +} | ||
134 | + | ||
135 | /** | ||
136 | * gtk_draw_hline: | ||
137 | * @style: a #GtkStyle | ||
138 | @@ -1717,10 +1781,32 @@ | ||
139 | clear_property_cache (style); | ||
140 | } | ||
141 | |||
142 | +static GSList * | ||
143 | +copy_object_list (GSList *list) | ||
144 | +{ | ||
145 | + if (list) | ||
146 | + { | ||
147 | + GSList *iter; | ||
148 | + | ||
149 | + iter = list; | ||
150 | + while (iter != NULL) | ||
151 | + { | ||
152 | + g_object_ref (iter->data); | ||
153 | + iter = g_slist_next (iter); | ||
154 | + } | ||
155 | + | ||
156 | + return g_slist_copy (list); | ||
157 | + } | ||
158 | + else | ||
159 | + return NULL; | ||
160 | +} | ||
161 | + | ||
162 | static void | ||
163 | gtk_style_real_init_from_rc (GtkStyle *style, | ||
164 | GtkRcStyle *rc_style) | ||
165 | { | ||
166 | + GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style); | ||
167 | + GSList *logical_color_hashes; | ||
168 | gint i; | ||
169 | |||
170 | /* cache _should_ be still empty */ | ||
171 | @@ -1746,19 +1832,10 @@ | ||
172 | if (rc_style->ythickness >= 0) | ||
173 | style->ythickness = rc_style->ythickness; | ||
174 | |||
175 | - if (rc_style->icon_factories) | ||
176 | - { | ||
177 | - GSList *iter; | ||
178 | + style->icon_factories = copy_object_list (rc_style->icon_factories); | ||
179 | |||
180 | - style->icon_factories = g_slist_copy (rc_style->icon_factories); | ||
181 | - | ||
182 | - iter = style->icon_factories; | ||
183 | - while (iter != NULL) | ||
184 | - { | ||
185 | - g_object_ref (iter->data); | ||
186 | - iter = g_slist_next (iter); | ||
187 | - } | ||
188 | - } | ||
189 | + logical_color_hashes = _gtk_rc_style_get_logical_color_hashes (rc_style); | ||
190 | + priv->logical_color_hashes = copy_object_list (logical_color_hashes); | ||
191 | } | ||
192 | |||
193 | static gint | ||
194 | @@ -2065,7 +2142,7 @@ | ||
195 | const gchar *detail) | ||
196 | { | ||
197 | GdkPixbuf *pixbuf; | ||
198 | - | ||
199 | + | ||
200 | g_return_val_if_fail (GTK_IS_STYLE (style), NULL); | ||
201 | g_return_val_if_fail (GTK_STYLE_GET_CLASS (style)->render_icon != NULL, NULL); | ||
202 | |||
203 | @@ -2156,7 +2233,7 @@ | ||
204 | { | ||
205 | return gdk_pixbuf_scale_simple (src, | ||
206 | width, height, | ||
207 | - GDK_INTERP_BILINEAR); | ||
208 | + GDK_INTERP_NEAREST); | ||
209 | } | ||
210 | } | ||
211 | |||
212 | @@ -2183,7 +2260,6 @@ | ||
213 | */ | ||
214 | |||
215 | base_pixbuf = gtk_icon_source_get_pixbuf (source); | ||
216 | - | ||
217 | g_return_val_if_fail (base_pixbuf != NULL, NULL); | ||
218 | |||
219 | if (widget && gtk_widget_has_screen (widget)) | ||
220 | @@ -2213,7 +2289,9 @@ | ||
221 | /* If the size was wildcarded, and we're allowed to scale, then scale; otherwise, | ||
222 | * leave it alone. | ||
223 | */ | ||
224 | - if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source)) | ||
225 | + /* Hildon addition: Device icons are never scaled */ | ||
226 | + if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source) | ||
227 | + && size < HILDON_ICON_SIZE_26) | ||
228 | scaled = scale_or_ref (base_pixbuf, width, height); | ||
229 | else | ||
230 | scaled = g_object_ref (base_pixbuf); | ||
231 | @@ -2224,7 +2302,7 @@ | ||
232 | if (state == GTK_STATE_INSENSITIVE) | ||
233 | { | ||
234 | stated = gdk_pixbuf_copy (scaled); | ||
235 | - | ||
236 | + | ||
237 | gdk_pixbuf_saturate_and_pixelate (scaled, stated, | ||
238 | 0.8, TRUE); | ||
239 | |||
240 | @@ -2232,8 +2310,8 @@ | ||
241 | } | ||
242 | else if (state == GTK_STATE_PRELIGHT) | ||
243 | { | ||
244 | - stated = gdk_pixbuf_copy (scaled); | ||
245 | - | ||
246 | + stated = gdk_pixbuf_copy (scaled); | ||
247 | + | ||
248 | gdk_pixbuf_saturate_and_pixelate (scaled, stated, | ||
249 | 1.2, FALSE); | ||
250 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkstyle.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkstyle.h.diff deleted file mode 100644 index 79c36bb47f..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkstyle.h.diff +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkstyle.h 2004-11-28 09:02:27.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkstyle.h 2005-04-06 16:19:37.952768664 +0300 | ||
3 | @@ -454,6 +454,10 @@ | ||
4 | gint width, | ||
5 | gint height); | ||
6 | |||
7 | +gboolean gtk_style_lookup_logical_color (GtkStyle *style, | ||
8 | + const gchar *color_name, | ||
9 | + GdkColor *color); | ||
10 | + | ||
11 | GtkIconSet* gtk_style_lookup_icon_set (GtkStyle *style, | ||
12 | const gchar *stock_id); | ||
13 | GdkPixbuf* gtk_style_render_icon (GtkStyle *style, | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktable.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktable.c.diff deleted file mode 100644 index 5f485da09b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktable.c.diff +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktable.c 2004-08-09 19:59:52.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtktable.c 2005-04-06 16:19:37.974765320 +0300 | ||
3 | @@ -28,6 +28,7 @@ | ||
4 | #include "gtkalias.h" | ||
5 | #include "gtktable.h" | ||
6 | #include "gtkintl.h" | ||
7 | +#include "gtkbutton.h" | ||
8 | |||
9 | enum | ||
10 | { | ||
11 | @@ -507,6 +508,33 @@ | ||
12 | return GTK_WIDGET (table); | ||
13 | } | ||
14 | |||
15 | +void osso_gtk_table_find_button_detail (GtkTable *table, | ||
16 | + GtkTableChild *table_child) | ||
17 | +{ | ||
18 | + OssoGtkButtonAttachFlags attachflags = 0; | ||
19 | + gboolean automatic_detail; | ||
20 | + | ||
21 | + g_return_if_fail (GTK_IS_TABLE (table)); | ||
22 | + g_return_if_fail (table_child != NULL); | ||
23 | + g_return_if_fail (GTK_IS_BUTTON (table_child->widget)); | ||
24 | + | ||
25 | + if (table_child->top_attach == 0) | ||
26 | + attachflags |= OSSO_GTK_BUTTON_ATTACH_NORTH; | ||
27 | + | ||
28 | + if (table_child->bottom_attach == table->nrows) | ||
29 | + attachflags |= OSSO_GTK_BUTTON_ATTACH_SOUTH; | ||
30 | + | ||
31 | + if (table_child->left_attach == 0) | ||
32 | + attachflags |= OSSO_GTK_BUTTON_ATTACH_WEST; | ||
33 | + | ||
34 | + if (table_child->right_attach == table->ncols) | ||
35 | + attachflags |= OSSO_GTK_BUTTON_ATTACH_EAST; | ||
36 | + | ||
37 | + g_object_get (G_OBJECT (table_child->widget), "automatic_detail", &automatic_detail, NULL); | ||
38 | + if (automatic_detail == TRUE) | ||
39 | + g_object_set (G_OBJECT (table_child->widget), "detail", osso_gtk_button_attach_details[attachflags], NULL); | ||
40 | +} | ||
41 | + | ||
42 | void | ||
43 | gtk_table_resize (GtkTable *table, | ||
44 | guint n_rows, | ||
45 | @@ -523,6 +551,18 @@ | ||
46 | n_cols != table->ncols) | ||
47 | { | ||
48 | GList *list; | ||
49 | + guint recalc_column = -1; | ||
50 | + guint recalc_row = -1; | ||
51 | + | ||
52 | + if (n_rows > table->nrows) | ||
53 | + recalc_row = table->nrows; | ||
54 | + else | ||
55 | + recalc_row = n_rows; | ||
56 | + | ||
57 | + if (n_cols > table->ncols) | ||
58 | + recalc_column = table->ncols; | ||
59 | + else | ||
60 | + recalc_column = n_cols; | ||
61 | |||
62 | for (list = table->children; list; list = list->next) | ||
63 | { | ||
64 | @@ -577,6 +617,20 @@ | ||
65 | |||
66 | g_object_notify (G_OBJECT (table), "n_columns"); | ||
67 | } | ||
68 | + | ||
69 | + if ((recalc_column != -1) || (recalc_row != -1)) | ||
70 | + for (list = table->children; list; list = list->next) | ||
71 | + { | ||
72 | + GtkTableChild *child; | ||
73 | + | ||
74 | + child = list->data; | ||
75 | + | ||
76 | + if (GTK_IS_BUTTON (child->widget) && | ||
77 | + ((child->bottom_attach == recalc_row) || | ||
78 | + (child->right_attach == recalc_column))) | ||
79 | + | ||
80 | + osso_gtk_table_find_button_detail (table, child); | ||
81 | + } | ||
82 | } | ||
83 | } | ||
84 | |||
85 | @@ -623,6 +677,10 @@ | ||
86 | table_child->yshrink = (yoptions & GTK_SHRINK) != 0; | ||
87 | table_child->yfill = (yoptions & GTK_FILL) != 0; | ||
88 | table_child->ypadding = ypadding; | ||
89 | + | ||
90 | + | ||
91 | + if (GTK_IS_BUTTON (table_child->widget)) | ||
92 | + osso_gtk_table_find_button_detail (table, table_child); | ||
93 | |||
94 | table->children = g_list_prepend (table->children, table_child); | ||
95 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbuffer.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbuffer.c.diff deleted file mode 100644 index 7a984dfb8c..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbuffer.c.diff +++ /dev/null | |||
@@ -1,443 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktextbuffer.c 2004-11-01 21:57:13.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktextbuffer.c 2005-04-06 16:19:38.023757872 +0300 | ||
3 | @@ -1,5 +1,6 @@ | ||
4 | /* GTK - The GIMP Toolkit | ||
5 | * gtktextbuffer.c Copyright (C) 2000 Red Hat, Inc. | ||
6 | + * Copyright (C) 2004 Nokia Corporation | ||
7 | * | ||
8 | * This library is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU Lesser General Public | ||
10 | @@ -39,6 +40,17 @@ | ||
11 | #include "gtktextbtree.h" | ||
12 | #include "gtktextiterprivate.h" | ||
13 | #include "gtkintl.h" | ||
14 | +#include "gtktextbufferserialize.h" | ||
15 | + | ||
16 | +#define GTK_TEXT_BUFFER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_TEXT_BUFFER, GtkTextBufferPrivate)) | ||
17 | + | ||
18 | +typedef struct _GtkTextBufferPrivate GtkTextBufferPrivate; | ||
19 | + | ||
20 | +struct _GtkTextBufferPrivate | ||
21 | +{ | ||
22 | + gboolean can_paste_rich_text; | ||
23 | + gchar *rich_text_format; | ||
24 | +}; | ||
25 | |||
26 | typedef struct _ClipboardRequest ClipboardRequest; | ||
27 | |||
28 | @@ -71,7 +83,10 @@ | ||
29 | PROP_0, | ||
30 | |||
31 | /* Construct */ | ||
32 | - PROP_TAG_TABLE | ||
33 | + PROP_TAG_TABLE, | ||
34 | + | ||
35 | + PROP_CAN_PASTE_RICH_TEXT, | ||
36 | + PROP_RICH_TEXT_FORMAT | ||
37 | }; | ||
38 | |||
39 | enum { | ||
40 | @@ -79,6 +94,8 @@ | ||
41 | TARGET_TEXT, | ||
42 | TARGET_COMPOUND_TEXT, | ||
43 | TARGET_UTF8_STRING, | ||
44 | + TARGET_TEXT_VIEW_MARKUP, | ||
45 | + TARGET_TEXT_VIEW_RICH_TEXT_FORMAT, | ||
46 | TARGET_TEXT_BUFFER_CONTENTS | ||
47 | }; | ||
48 | |||
49 | @@ -185,7 +202,20 @@ | ||
50 | P_("Text Tag Table"), | ||
51 | GTK_TYPE_TEXT_TAG_TABLE, | ||
52 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); | ||
53 | + g_object_class_install_property (object_class, | ||
54 | + PROP_CAN_PASTE_RICH_TEXT, | ||
55 | + g_param_spec_boolean ("can_paste_rich_text", | ||
56 | + P_("Can paste rich text"), | ||
57 | + P_("Whether it should be possible to paste rich text to the buffer"), | ||
58 | + FALSE, G_PARAM_READWRITE)); | ||
59 | + g_object_class_install_property (object_class, | ||
60 | + PROP_RICH_TEXT_FORMAT, | ||
61 | + g_param_spec_string ("rich_text_format", | ||
62 | + P_("Rich Text Format"), | ||
63 | + P_("Name of a collection of tags that the text view supports"), | ||
64 | + NULL, G_PARAM_READWRITE)); | ||
65 | |||
66 | + | ||
67 | signals[INSERT_TEXT] = | ||
68 | g_signal_new ("insert_text", | ||
69 | G_OBJECT_CLASS_TYPE (object_class), | ||
70 | @@ -335,7 +365,9 @@ | ||
71 | NULL, NULL, | ||
72 | _gtk_marshal_VOID__VOID, | ||
73 | G_TYPE_NONE, | ||
74 | - 0); | ||
75 | + 0); | ||
76 | + | ||
77 | + g_type_class_add_private (object_class, sizeof (GtkTextBufferPrivate)); | ||
78 | } | ||
79 | |||
80 | static void | ||
81 | @@ -385,7 +417,12 @@ | ||
82 | case PROP_TAG_TABLE: | ||
83 | set_table (text_buffer, g_value_get_object (value)); | ||
84 | break; | ||
85 | - | ||
86 | + case PROP_CAN_PASTE_RICH_TEXT: | ||
87 | + gtk_text_buffer_set_can_paste_rich_text (text_buffer, g_value_get_boolean (value)); | ||
88 | + break; | ||
89 | + case PROP_RICH_TEXT_FORMAT: | ||
90 | + gtk_text_buffer_set_rich_text_format (text_buffer, g_value_get_string (value)); | ||
91 | + break; | ||
92 | default: | ||
93 | break; | ||
94 | } | ||
95 | @@ -406,7 +443,14 @@ | ||
96 | case PROP_TAG_TABLE: | ||
97 | g_value_set_object (value, get_table (text_buffer)); | ||
98 | break; | ||
99 | - | ||
100 | + case PROP_CAN_PASTE_RICH_TEXT: | ||
101 | + g_value_set_boolean (value, | ||
102 | + gtk_text_buffer_get_can_paste_rich_text (text_buffer)); | ||
103 | + break; | ||
104 | + case PROP_RICH_TEXT_FORMAT: | ||
105 | + g_value_set_string (value, | ||
106 | + gtk_text_buffer_get_rich_text_format (text_buffer)); | ||
107 | + break; | ||
108 | default: | ||
109 | break; | ||
110 | } | ||
111 | @@ -434,11 +478,14 @@ | ||
112 | gtk_text_buffer_finalize (GObject *object) | ||
113 | { | ||
114 | GtkTextBuffer *buffer; | ||
115 | + GtkTextBufferPrivate *priv; | ||
116 | |||
117 | buffer = GTK_TEXT_BUFFER (object); | ||
118 | |||
119 | remove_all_selection_clipboards (buffer); | ||
120 | |||
121 | + priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer); | ||
122 | + | ||
123 | if (buffer->tag_table) | ||
124 | { | ||
125 | _gtk_text_tag_table_remove_buffer (buffer->tag_table, buffer); | ||
126 | @@ -456,7 +503,9 @@ | ||
127 | free_log_attr_cache (buffer->log_attr_cache); | ||
128 | |||
129 | buffer->log_attr_cache = NULL; | ||
130 | - | ||
131 | + | ||
132 | + g_free (priv->rich_text_format); | ||
133 | + | ||
134 | G_OBJECT_CLASS (parent_class)->finalize (object); | ||
135 | } | ||
136 | |||
137 | @@ -2738,8 +2787,7 @@ | ||
138 | |||
139 | if (gtk_text_buffer_get_selection_bounds (buffer, &start, &end)) | ||
140 | { | ||
141 | - if (selection_data->target == | ||
142 | - gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE)) | ||
143 | + if (info == TARGET_TEXT_BUFFER_CONTENTS) | ||
144 | { | ||
145 | /* Provide the address of the buffer; this will only be | ||
146 | * used within-process | ||
147 | @@ -2750,6 +2798,32 @@ | ||
148 | (void*)&buffer, | ||
149 | sizeof (buffer)); | ||
150 | } | ||
151 | + else if (info == TARGET_TEXT_VIEW_MARKUP) | ||
152 | + { | ||
153 | + gchar *str; | ||
154 | + gint len; | ||
155 | + | ||
156 | + str = gtk_text_buffer_serialize_rich_text (buffer, &start, &end, &len); | ||
157 | + | ||
158 | + gtk_selection_data_set (selection_data, | ||
159 | + gdk_atom_intern ("application/x-gtk-text-view-markup", FALSE), | ||
160 | + 8, /* bytes */ | ||
161 | + str, len); | ||
162 | + g_free (str); | ||
163 | + } | ||
164 | + else if (info == TARGET_TEXT_VIEW_RICH_TEXT_FORMAT) | ||
165 | + { | ||
166 | + gint len; | ||
167 | + gchar *format; | ||
168 | + | ||
169 | + format = g_object_get_data (G_OBJECT (buffer), "gtk-text-buffer-clipboard-format"); | ||
170 | + len = format ? strlen (format) : -1; | ||
171 | + | ||
172 | + gtk_selection_data_set (selection_data, | ||
173 | + gdk_atom_intern ("application/x-gtk-text-view-rich-text-format", FALSE), | ||
174 | + 8, /* bytes */ | ||
175 | + format, len); | ||
176 | + } | ||
177 | else | ||
178 | { | ||
179 | gchar *str; | ||
180 | @@ -2765,10 +2839,16 @@ | ||
181 | create_clipboard_contents_buffer (GtkTextBuffer *buffer) | ||
182 | { | ||
183 | GtkTextBuffer *contents; | ||
184 | + gchar *format; | ||
185 | |||
186 | contents = gtk_text_buffer_new (gtk_text_buffer_get_tag_table (buffer)); | ||
187 | |||
188 | + format = GTK_TEXT_BUFFER_GET_PRIVATE (buffer)->rich_text_format; | ||
189 | + | ||
190 | g_object_set_data (G_OBJECT (contents), "gtk-text-buffer-clipboard", GINT_TO_POINTER (1)); | ||
191 | + | ||
192 | + g_object_set_data_full (G_OBJECT (contents), "gtk-text-buffer-clipboard-format", | ||
193 | + format ? g_strdup (format) : NULL, g_free); | ||
194 | |||
195 | return contents; | ||
196 | } | ||
197 | @@ -2786,8 +2866,7 @@ | ||
198 | |||
199 | g_assert (contents); /* This should never be called unless we own the clipboard */ | ||
200 | |||
201 | - if (selection_data->target == | ||
202 | - gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE)) | ||
203 | + if (info == TARGET_TEXT_BUFFER_CONTENTS) | ||
204 | { | ||
205 | /* Provide the address of the clipboard buffer; this will only | ||
206 | * be used within-process. OK to supply a NULL value for contents. | ||
207 | @@ -2798,6 +2877,35 @@ | ||
208 | (void*)&contents, | ||
209 | sizeof (contents)); | ||
210 | } | ||
211 | + else if (info == TARGET_TEXT_VIEW_MARKUP) | ||
212 | + { | ||
213 | + gchar *str; | ||
214 | + gint *len; | ||
215 | + GtkTextIter start, end; | ||
216 | + | ||
217 | + gtk_text_buffer_get_bounds (contents, &start, &end); | ||
218 | + | ||
219 | + str = gtk_text_buffer_serialize_rich_text (contents, &start, &end, &len); | ||
220 | + | ||
221 | + gtk_selection_data_set (selection_data, | ||
222 | + gdk_atom_intern ("application/x-gtk-text-view-markup", FALSE), | ||
223 | + 8, /* bytes */ | ||
224 | + str, len); | ||
225 | + g_free (str); | ||
226 | + } | ||
227 | + else if (info == TARGET_TEXT_VIEW_RICH_TEXT_FORMAT) | ||
228 | + { | ||
229 | + gint len; | ||
230 | + gchar *format; | ||
231 | + | ||
232 | + format = g_object_get_data (G_OBJECT (contents), "gtk-text-buffer-clipboard-format"); | ||
233 | + len = format ? strlen (format) : -1; | ||
234 | + | ||
235 | + gtk_selection_data_set (selection_data, | ||
236 | + gdk_atom_intern ("application/x-gtk-text-view-rich-text-format", FALSE), | ||
237 | + 8, /* bytes */ | ||
238 | + format, len); | ||
239 | + } | ||
240 | else | ||
241 | { | ||
242 | gchar *str; | ||
243 | @@ -2992,6 +3100,54 @@ | ||
244 | #endif | ||
245 | |||
246 | static void | ||
247 | +clipboard_text_view_markup_received (GtkClipboard *clipboard, | ||
248 | + GtkSelectionData *selection_data, | ||
249 | + gpointer data) | ||
250 | +{ | ||
251 | + ClipboardRequest *request_data = data; | ||
252 | + GtkTextIter insert_point; | ||
253 | + gboolean retval = TRUE; | ||
254 | + GError *error = NULL; | ||
255 | + GtkTextBufferPrivate *priv; | ||
256 | + | ||
257 | + priv = GTK_TEXT_BUFFER_GET_PRIVATE (request_data->buffer); | ||
258 | + | ||
259 | + if (selection_data->target == | ||
260 | + gdk_atom_intern ("application/x-gtk-text-view-markup", FALSE)) | ||
261 | + { | ||
262 | + pre_paste_prep (request_data, &insert_point); | ||
263 | + | ||
264 | + if (request_data->interactive) | ||
265 | + gtk_text_buffer_begin_user_action (request_data->buffer); | ||
266 | + | ||
267 | + if (!request_data->interactive || | ||
268 | + gtk_text_iter_can_insert (&insert_point, request_data->default_editable)) | ||
269 | + retval = gtk_text_buffer_deserialize_rich_text (request_data->buffer, | ||
270 | + &insert_point, | ||
271 | + selection_data->data, selection_data->length, | ||
272 | + priv->rich_text_format == NULL, &error); | ||
273 | + | ||
274 | + if (!retval) | ||
275 | + { | ||
276 | + g_warning ("error pasting: %s\n", error->message); | ||
277 | + } | ||
278 | + | ||
279 | + if (request_data->interactive) | ||
280 | + gtk_text_buffer_end_user_action (request_data->buffer); | ||
281 | + | ||
282 | + if (retval) { | ||
283 | + post_paste_cleanup (request_data); | ||
284 | + return; | ||
285 | + } | ||
286 | + } | ||
287 | + | ||
288 | + /* Request the text selection instead */ | ||
289 | + gtk_clipboard_request_text (clipboard, | ||
290 | + clipboard_text_received, | ||
291 | + data); | ||
292 | +} | ||
293 | + | ||
294 | +static void | ||
295 | paste_from_buffer (ClipboardRequest *request_data, | ||
296 | GtkTextBuffer *src_buffer, | ||
297 | const GtkTextIter *start, | ||
298 | @@ -3029,6 +3185,35 @@ | ||
299 | g_free (request_data); | ||
300 | } | ||
301 | |||
302 | +static gboolean | ||
303 | +formats_match (GtkClipboard *clipboard, const gchar *format) | ||
304 | +{ | ||
305 | + GtkSelectionData *data; | ||
306 | + gchar *tmp; | ||
307 | + gboolean retval; | ||
308 | + | ||
309 | + if (!format) | ||
310 | + return TRUE; | ||
311 | + | ||
312 | + data = gtk_clipboard_wait_for_contents (clipboard, | ||
313 | + gdk_atom_intern ("application/x-gtk-text-view-rich-text-format", FALSE)); | ||
314 | + | ||
315 | + if (data->length <= 0) | ||
316 | + retval = FALSE; | ||
317 | + else | ||
318 | + { | ||
319 | + tmp = g_strndup (data->data, data->length); | ||
320 | + | ||
321 | + retval = (strcmp (tmp, format) == 0); | ||
322 | + | ||
323 | + g_free (tmp); | ||
324 | + } | ||
325 | + | ||
326 | + gtk_selection_data_free (data); | ||
327 | + | ||
328 | + return retval; | ||
329 | +} | ||
330 | + | ||
331 | static void | ||
332 | clipboard_clipboard_buffer_received (GtkClipboard *clipboard, | ||
333 | GtkSelectionData *selection_data, | ||
334 | @@ -3036,6 +3221,7 @@ | ||
335 | { | ||
336 | ClipboardRequest *request_data = data; | ||
337 | GtkTextBuffer *src_buffer; | ||
338 | + GtkTextBufferPrivate *priv; | ||
339 | |||
340 | src_buffer = selection_data_get_buffer (selection_data, request_data); | ||
341 | |||
342 | @@ -3059,10 +3245,19 @@ | ||
343 | } | ||
344 | else | ||
345 | { | ||
346 | - /* Request the text selection instead */ | ||
347 | - gtk_clipboard_request_text (clipboard, | ||
348 | - clipboard_text_received, | ||
349 | - data); | ||
350 | + priv = GTK_TEXT_BUFFER_GET_PRIVATE (request_data->buffer); | ||
351 | + | ||
352 | + if (priv->can_paste_rich_text && | ||
353 | + formats_match (clipboard, priv->rich_text_format)) | ||
354 | + /* Request markup */ | ||
355 | + gtk_clipboard_request_contents (clipboard, | ||
356 | + gdk_atom_intern ("application/x-gtk-text-view-markup", FALSE), | ||
357 | + clipboard_text_view_markup_received, data); | ||
358 | + else | ||
359 | + /* Request the text selection instead */ | ||
360 | + gtk_clipboard_request_text (clipboard, | ||
361 | + clipboard_text_received, | ||
362 | + data); | ||
363 | } | ||
364 | } | ||
365 | |||
366 | @@ -3071,6 +3266,8 @@ | ||
367 | { "TEXT", 0, TARGET_TEXT }, | ||
368 | { "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT }, | ||
369 | { "UTF8_STRING", 0, TARGET_UTF8_STRING }, | ||
370 | + { "application/x-gtk-text-view-markup", 0, TARGET_TEXT_VIEW_MARKUP }, | ||
371 | + { "application/x-gtk-text-view-rich-text-format", 0, TARGET_TEXT_VIEW_RICH_TEXT_FORMAT }, | ||
372 | { "GTK_TEXT_BUFFER_CONTENTS", 0, TARGET_TEXT_BUFFER_CONTENTS } | ||
373 | }; | ||
374 | |||
375 | @@ -3591,6 +3788,68 @@ | ||
376 | } | ||
377 | } | ||
378 | |||
379 | +void | ||
380 | +gtk_text_buffer_set_can_paste_rich_text (GtkTextBuffer *buffer, | ||
381 | + gboolean can_paste_rich_text) | ||
382 | +{ | ||
383 | + GtkTextBufferPrivate *priv; | ||
384 | + | ||
385 | + g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer)); | ||
386 | + | ||
387 | + priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer); | ||
388 | + | ||
389 | + can_paste_rich_text = (can_paste_rich_text != FALSE); | ||
390 | + | ||
391 | + if (priv->can_paste_rich_text != can_paste_rich_text) | ||
392 | + { | ||
393 | + priv->can_paste_rich_text = can_paste_rich_text; | ||
394 | + | ||
395 | + g_object_notify (G_OBJECT (buffer), "can_paste_rich_text"); | ||
396 | + } | ||
397 | +} | ||
398 | + | ||
399 | +gboolean | ||
400 | +gtk_text_buffer_get_can_paste_rich_text (GtkTextBuffer *buffer) | ||
401 | +{ | ||
402 | + GtkTextBufferPrivate *priv; | ||
403 | + | ||
404 | + g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE); | ||
405 | + | ||
406 | + priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer); | ||
407 | + | ||
408 | + return priv->can_paste_rich_text; | ||
409 | +} | ||
410 | + | ||
411 | +void | ||
412 | +gtk_text_buffer_set_rich_text_format (GtkTextBuffer *buffer, | ||
413 | + const gchar *format) | ||
414 | +{ | ||
415 | + gchar *new_format; | ||
416 | + GtkTextBufferPrivate *priv; | ||
417 | + | ||
418 | + g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer)); | ||
419 | + | ||
420 | + priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer); | ||
421 | + | ||
422 | + new_format = g_strdup (format); | ||
423 | + g_free (priv->rich_text_format); | ||
424 | + | ||
425 | + priv->rich_text_format = new_format; | ||
426 | + g_object_notify (G_OBJECT (buffer), "rich_text_format"); | ||
427 | +} | ||
428 | + | ||
429 | +G_CONST_RETURN gchar * | ||
430 | +gtk_text_buffer_get_rich_text_format (GtkTextBuffer *buffer) | ||
431 | +{ | ||
432 | + GtkTextBufferPrivate *priv; | ||
433 | + | ||
434 | + g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); | ||
435 | + | ||
436 | + priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer); | ||
437 | + | ||
438 | + return priv->rich_text_format; | ||
439 | +} | ||
440 | + | ||
441 | /* | ||
442 | * Logical attribute cache | ||
443 | */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbuffer.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbuffer.h.diff deleted file mode 100644 index 61555eac8b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbuffer.h.diff +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktextbuffer.h 2004-10-21 22:13:17.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtktextbuffer.h 2005-04-06 16:19:38.024757720 +0300 | ||
3 | @@ -365,6 +365,14 @@ | ||
4 | void gtk_text_buffer_begin_user_action (GtkTextBuffer *buffer); | ||
5 | void gtk_text_buffer_end_user_action (GtkTextBuffer *buffer); | ||
6 | |||
7 | +void gtk_text_buffer_set_can_paste_rich_text (GtkTextBuffer *buffer, | ||
8 | + gboolean can_paste_rich_text); | ||
9 | +gboolean gtk_text_buffer_get_can_paste_rich_text (GtkTextBuffer *buffer); | ||
10 | + | ||
11 | +void gtk_text_buffer_set_rich_text_format (GtkTextBuffer *buffer, | ||
12 | + const gchar *format); | ||
13 | +G_CONST_RETURN gchar *gtk_text_buffer_get_rich_text_format (GtkTextBuffer *buffer); | ||
14 | + | ||
15 | /* INTERNAL private stuff */ | ||
16 | void _gtk_text_buffer_spew (GtkTextBuffer *buffer); | ||
17 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbufferserialize.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbufferserialize.c.diff deleted file mode 100644 index 39c8f748de..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbufferserialize.c.diff +++ /dev/null | |||
@@ -1,1688 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktextbufferserialize.c 1970-01-01 02:00:00.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktextbufferserialize.c 2005-04-06 16:19:38.024757720 +0300 | ||
3 | @@ -0,0 +1,1685 @@ | ||
4 | +/* gtktextbufferserialize.c | ||
5 | + * | ||
6 | + * Copyright (C) 2001 Havoc Pennington | ||
7 | + * Copyright (C) 2004 Nokia | ||
8 | + * | ||
9 | + * This library is free software; you can redistribute it and/or | ||
10 | + * modify it under the terms of the GNU Library General Public | ||
11 | + * License as published by the Free Software Foundation; either | ||
12 | + * version 2 of the License, or (at your option) any later version. | ||
13 | + * | ||
14 | + * This library is distributed in the hope that it will be useful, | ||
15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | + * Library General Public License for more details. | ||
18 | + * | ||
19 | + * You should have received a copy of the GNU Library General Public | ||
20 | + * License along with this library; if not, write to the | ||
21 | + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
22 | + * Boston, MA 02111-1307, USA. | ||
23 | + */ | ||
24 | + | ||
25 | +/* FIXME: We should use other error codes for the | ||
26 | + * parts that deal with the format errors | ||
27 | + */ | ||
28 | + | ||
29 | +#include <config.h> | ||
30 | + | ||
31 | +#include <stdio.h> | ||
32 | +#include "gdk-pixbuf/gdk-pixdata.h" | ||
33 | +#include "gtktextbufferserialize.h" | ||
34 | +#include "gtkintl.h" | ||
35 | + | ||
36 | +#include <string.h> | ||
37 | +#include <stdlib.h> | ||
38 | + | ||
39 | +typedef struct | ||
40 | +{ | ||
41 | + GString *tag_table_str; | ||
42 | + GString *text_str; | ||
43 | + GHashTable *tags; | ||
44 | + GtkTextIter start, end; | ||
45 | + | ||
46 | + gint n_pixbufs; | ||
47 | + GList *pixbufs; | ||
48 | +} SerializationContext; | ||
49 | + | ||
50 | +static gchar * | ||
51 | +serialize_value (GValue *value) | ||
52 | +{ | ||
53 | + if (g_value_type_transformable (value->g_type, G_TYPE_STRING)) | ||
54 | + { | ||
55 | + GValue text_value = { 0 }; | ||
56 | + gchar *tmp; | ||
57 | + | ||
58 | + g_value_init (&text_value, G_TYPE_STRING); | ||
59 | + g_value_transform (value, &text_value); | ||
60 | + | ||
61 | + tmp = g_markup_escape_text (g_value_get_string (&text_value), -1); | ||
62 | + g_value_unset (&text_value); | ||
63 | + | ||
64 | + return tmp; | ||
65 | + } | ||
66 | + else if (value->g_type == GDK_TYPE_COLOR) | ||
67 | + { | ||
68 | + GdkColor *color = g_value_get_boxed (value); | ||
69 | + | ||
70 | + return g_strdup_printf ("%x:%x:%x", color->red, color->green, color->blue); | ||
71 | + } | ||
72 | + else | ||
73 | + { | ||
74 | + g_warning ("Type %s is not serializable\n", g_type_name (value->g_type)); | ||
75 | + } | ||
76 | + | ||
77 | + return NULL; | ||
78 | +} | ||
79 | + | ||
80 | +static gboolean | ||
81 | +deserialize_value (const gchar *str, GValue *value) | ||
82 | +{ | ||
83 | + if (g_value_type_transformable (G_TYPE_STRING, value->g_type)) | ||
84 | + { | ||
85 | + GValue text_value = { 0 }; | ||
86 | + gboolean retval; | ||
87 | + | ||
88 | + g_value_init (&text_value, G_TYPE_STRING); | ||
89 | + g_value_set_static_string (&text_value, str); | ||
90 | + | ||
91 | + retval = g_value_transform (&text_value, value); | ||
92 | + g_value_unset (&text_value); | ||
93 | + | ||
94 | + return retval; | ||
95 | + } | ||
96 | + else if (value->g_type == G_TYPE_BOOLEAN) | ||
97 | + { | ||
98 | + gboolean v; | ||
99 | + | ||
100 | + v = strcmp (str, "TRUE") == 0; | ||
101 | + | ||
102 | + g_value_set_boolean (value, v); | ||
103 | + | ||
104 | + return TRUE; | ||
105 | + } | ||
106 | + else if (value->g_type == G_TYPE_INT) | ||
107 | + { | ||
108 | + gchar *tmp; | ||
109 | + int v; | ||
110 | + | ||
111 | + v = strtol (str, &tmp, 10); | ||
112 | + | ||
113 | + if (tmp == NULL || tmp == str) | ||
114 | + return FALSE; | ||
115 | + | ||
116 | + g_value_set_int (value, v); | ||
117 | + | ||
118 | + return TRUE; | ||
119 | + } | ||
120 | + else if (value->g_type == G_TYPE_DOUBLE) | ||
121 | + { | ||
122 | + gchar *tmp; | ||
123 | + gdouble v; | ||
124 | + | ||
125 | + v = g_ascii_strtod (str, &tmp); | ||
126 | + | ||
127 | + if (tmp == NULL || tmp == str) | ||
128 | + return FALSE; | ||
129 | + | ||
130 | + g_value_set_double (value, v); | ||
131 | + | ||
132 | + return TRUE; | ||
133 | + } | ||
134 | + else if (value->g_type == GDK_TYPE_COLOR) | ||
135 | + { | ||
136 | + GdkColor color; | ||
137 | + const gchar *old; | ||
138 | + gchar *tmp; | ||
139 | + | ||
140 | + old = str; | ||
141 | + color.red = strtol (old, &tmp, 16); | ||
142 | + | ||
143 | + if (tmp == NULL || tmp == old) | ||
144 | + return FALSE; | ||
145 | + | ||
146 | + old = tmp; | ||
147 | + if (*old++ != ':') | ||
148 | + return FALSE; | ||
149 | + | ||
150 | + color.green = strtol (old, &tmp, 16); | ||
151 | + if (tmp == NULL || tmp == old) | ||
152 | + return FALSE; | ||
153 | + | ||
154 | + old = tmp; | ||
155 | + if (*old++ != ':') | ||
156 | + return FALSE; | ||
157 | + | ||
158 | + color.blue = strtol (old, &tmp, 16); | ||
159 | + | ||
160 | + if (tmp == NULL || tmp == old || *tmp != '\0') | ||
161 | + return FALSE; | ||
162 | + | ||
163 | + g_value_set_boxed (value, &color); | ||
164 | + | ||
165 | + return TRUE; | ||
166 | + } | ||
167 | + else if (G_VALUE_HOLDS_ENUM (value)) | ||
168 | + { | ||
169 | + GEnumClass *class = G_ENUM_CLASS (g_type_class_peek (value->g_type)); | ||
170 | + GEnumValue *enum_value; | ||
171 | + | ||
172 | + enum_value = g_enum_get_value_by_name (class, str); | ||
173 | + | ||
174 | + if (enum_value) | ||
175 | + { | ||
176 | + g_value_set_enum (value, enum_value->value); | ||
177 | + return TRUE; | ||
178 | + } | ||
179 | + | ||
180 | + return FALSE; | ||
181 | + } | ||
182 | + else | ||
183 | + { | ||
184 | + g_warning ("Type %s can not be deserialized\n", g_type_name (value->g_type)); | ||
185 | + } | ||
186 | + | ||
187 | + return FALSE; | ||
188 | +} | ||
189 | + | ||
190 | +/* Checks if a param is set, or if it's the default value */ | ||
191 | +static gboolean | ||
192 | +is_param_set (GObject *object, GParamSpec *pspec, GValue *value) | ||
193 | +{ | ||
194 | + /* We need to special case some attributes here */ | ||
195 | + if (strcmp (pspec->name, "background-gdk") == 0) | ||
196 | + { | ||
197 | + gboolean is_set; | ||
198 | + | ||
199 | + g_object_get (object, "background-set", &is_set, NULL); | ||
200 | + | ||
201 | + if (is_set) | ||
202 | + { | ||
203 | + g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec)); | ||
204 | + | ||
205 | + g_object_get_property (object, pspec->name, value); | ||
206 | + | ||
207 | + return TRUE; | ||
208 | + } | ||
209 | + | ||
210 | + return FALSE; | ||
211 | + } | ||
212 | + else if (strcmp (pspec->name, "foreground-gdk") == 0) | ||
213 | + { | ||
214 | + gboolean is_set; | ||
215 | + | ||
216 | + g_object_get (object, "foreground-set", &is_set, NULL); | ||
217 | + | ||
218 | + if (is_set) | ||
219 | + { | ||
220 | + g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec)); | ||
221 | + | ||
222 | + g_object_get_property (object, pspec->name, value); | ||
223 | + | ||
224 | + return TRUE; | ||
225 | + } | ||
226 | + | ||
227 | + return FALSE; | ||
228 | + } | ||
229 | + else | ||
230 | + { | ||
231 | + gboolean is_set; | ||
232 | + gchar *is_set_name; | ||
233 | + | ||
234 | + is_set_name = g_strdup_printf ("%s-set", pspec->name); | ||
235 | + | ||
236 | + if (g_object_class_find_property (G_OBJECT_GET_CLASS (object), is_set_name) == NULL) | ||
237 | + { | ||
238 | + g_free (is_set_name); | ||
239 | + return FALSE; | ||
240 | + } | ||
241 | + else | ||
242 | + { | ||
243 | + g_object_get (object, is_set_name, &is_set, NULL); | ||
244 | + | ||
245 | + if (!is_set) | ||
246 | + { | ||
247 | + g_free (is_set_name); | ||
248 | + return FALSE; | ||
249 | + } | ||
250 | + | ||
251 | + g_free (is_set_name); | ||
252 | + | ||
253 | + g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec)); | ||
254 | + | ||
255 | + g_object_get_property (object, pspec->name, value); | ||
256 | + | ||
257 | + if (g_param_value_defaults (pspec, value)) | ||
258 | + { | ||
259 | + g_value_unset (value); | ||
260 | + | ||
261 | + return FALSE; | ||
262 | + } | ||
263 | + } | ||
264 | + return TRUE; | ||
265 | + } | ||
266 | +} | ||
267 | + | ||
268 | +static void | ||
269 | +serialize_tag (gpointer key, gpointer data, gpointer user_data) | ||
270 | +{ | ||
271 | + SerializationContext *context = user_data; | ||
272 | + GtkTextTag *tag = data; | ||
273 | + gchar *tag_name; | ||
274 | + GParamSpec **pspecs; | ||
275 | + guint n_pspecs; | ||
276 | + int i; | ||
277 | + | ||
278 | + tag_name = g_markup_escape_text (tag->name, -1); | ||
279 | + g_string_append_printf (context->tag_table_str, " <tag name=\"%s\" priority=\"%d\">\n", tag_name, tag->priority); | ||
280 | + | ||
281 | + /* Serialize properties */ | ||
282 | + pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (tag), &n_pspecs); | ||
283 | + | ||
284 | + for (i = 0; i < n_pspecs; i++) | ||
285 | + { | ||
286 | + GValue value = { 0 }; | ||
287 | + gchar *tmp, *tmp2; | ||
288 | + | ||
289 | + if (!(pspecs[i]->flags & G_PARAM_READABLE) || | ||
290 | + !(pspecs[i]->flags & G_PARAM_WRITABLE)) | ||
291 | + continue; | ||
292 | + | ||
293 | + if (!is_param_set (G_OBJECT (tag), pspecs[i], &value)) | ||
294 | + continue; | ||
295 | + | ||
296 | + /* Now serialize the attr */ | ||
297 | + tmp = g_markup_escape_text (pspecs[i]->name, -1); | ||
298 | + g_string_append_printf (context->tag_table_str, " <attr name=\"%s\" ", tmp); | ||
299 | + g_free (tmp); | ||
300 | + | ||
301 | + tmp = g_markup_escape_text (g_type_name (pspecs[i]->value_type), -1); | ||
302 | + tmp2 = serialize_value (&value); | ||
303 | + g_string_append_printf (context->tag_table_str, "type=\"%s\" value=\"%s\" />\n", tmp, tmp2); | ||
304 | + | ||
305 | + g_free (tmp); | ||
306 | + g_free (tmp2); | ||
307 | + | ||
308 | + g_value_unset (&value); | ||
309 | + } | ||
310 | + | ||
311 | + g_free (pspecs); | ||
312 | + | ||
313 | + g_string_append (context->tag_table_str, " </tag>\n"); | ||
314 | + g_free (tag_name); | ||
315 | +} | ||
316 | + | ||
317 | +static void | ||
318 | +serialize_tags (SerializationContext *context) | ||
319 | +{ | ||
320 | + g_string_append (context->tag_table_str, " <text_view_markup>\n"); | ||
321 | + g_string_append (context->tag_table_str, " <tags>\n"); | ||
322 | + g_hash_table_foreach (context->tags, serialize_tag, context); | ||
323 | + g_string_append (context->tag_table_str, " </tags>\n"); | ||
324 | +} | ||
325 | + | ||
326 | +#if 0 | ||
327 | +static void | ||
328 | +dump_tag_list (const gchar *str, GList *list) | ||
329 | +{ | ||
330 | + g_print ("%s: ", str); | ||
331 | + | ||
332 | + if (!list) | ||
333 | + g_print ("(empty)"); | ||
334 | + else | ||
335 | + { | ||
336 | + while (list) | ||
337 | + { | ||
338 | + g_print ("%s ", ((GtkTextTag *)list->data)->name); | ||
339 | + list = list->next; | ||
340 | + } | ||
341 | + } | ||
342 | + | ||
343 | + g_print ("\n"); | ||
344 | +} | ||
345 | +#endif | ||
346 | + | ||
347 | +static void | ||
348 | +find_list_delta (GSList *old_list, GSList *new_list, | ||
349 | + GList **added, GList **removed) | ||
350 | +{ | ||
351 | + GSList *tmp; | ||
352 | + GList *tmp_added, *tmp_removed; | ||
353 | + | ||
354 | + tmp_added = NULL; | ||
355 | + tmp_removed = NULL; | ||
356 | + | ||
357 | + /* Find added tags */ | ||
358 | + tmp = new_list; | ||
359 | + while (tmp) | ||
360 | + { | ||
361 | + if (!g_slist_find (old_list, tmp->data)) | ||
362 | + tmp_added = g_list_prepend (tmp_added, tmp->data); | ||
363 | + | ||
364 | + tmp = tmp->next; | ||
365 | + } | ||
366 | + | ||
367 | + *added = tmp_added; | ||
368 | + | ||
369 | + /* Find removed tags */ | ||
370 | + tmp = old_list; | ||
371 | + while (tmp) | ||
372 | + { | ||
373 | + if (!g_slist_find (new_list, tmp->data)) | ||
374 | + tmp_removed = g_list_prepend (tmp_removed, tmp->data); | ||
375 | + | ||
376 | + tmp = tmp->next; | ||
377 | + } | ||
378 | + | ||
379 | + /* We reverse the list here to match the xml semantics */ | ||
380 | + *removed = g_list_reverse (tmp_removed); | ||
381 | +} | ||
382 | + | ||
383 | +static void | ||
384 | +serialize_section_header (GString *str, | ||
385 | + const gchar *name, | ||
386 | + gint length) | ||
387 | +{ | ||
388 | + g_return_if_fail (strlen (name) == 8); | ||
389 | + | ||
390 | + g_string_append (str, name); | ||
391 | + | ||
392 | + g_string_append_c (str, length >> 24); | ||
393 | + | ||
394 | + g_string_append_c (str, (length >> 16) & 0xff); | ||
395 | + g_string_append_c (str, (length >> 8) & 0xff); | ||
396 | + g_string_append_c (str, length & 0xff); | ||
397 | +} | ||
398 | + | ||
399 | +static void | ||
400 | +serialize_text (GtkTextBuffer *buffer, SerializationContext *context) | ||
401 | +{ | ||
402 | + GtkTextIter iter, old_iter; | ||
403 | + GSList *tag_list, *new_tag_list; | ||
404 | + GQueue *active_tags; | ||
405 | + int i; | ||
406 | + | ||
407 | + g_string_append (context->text_str, "<text>"); | ||
408 | + | ||
409 | + iter = context->start; | ||
410 | + tag_list = NULL; | ||
411 | + active_tags = g_queue_new (); | ||
412 | + | ||
413 | + do | ||
414 | + { | ||
415 | + GList *added, *removed; | ||
416 | + GList *tmp; | ||
417 | + gchar *tmp_text, *escaped_text; | ||
418 | + | ||
419 | + new_tag_list = gtk_text_iter_get_tags (&iter); | ||
420 | + find_list_delta (tag_list, new_tag_list, &added, &removed); | ||
421 | + | ||
422 | + /* Handle removed tags */ | ||
423 | + tmp = removed; | ||
424 | + while (tmp) | ||
425 | + { | ||
426 | + GtkTextTag *tag = tmp->data; | ||
427 | + | ||
428 | + g_string_append (context->text_str, "</apply_tag>"); | ||
429 | + | ||
430 | + /* We might need to drop some of the tags and re-add them afterwards */ | ||
431 | + while (g_queue_peek_head (active_tags) != tag && | ||
432 | + !g_queue_is_empty (active_tags)) | ||
433 | + { | ||
434 | + added = g_list_prepend (added, g_queue_pop_head (active_tags)); | ||
435 | + g_string_append_printf (context->text_str, "</apply_tag>"); | ||
436 | + } | ||
437 | + | ||
438 | + g_queue_pop_head (active_tags); | ||
439 | + | ||
440 | + tmp = tmp->next; | ||
441 | + } | ||
442 | + | ||
443 | + /* Handle added tags */ | ||
444 | + tmp = added; | ||
445 | + while (tmp) | ||
446 | + { | ||
447 | + GtkTextTag *tag = tmp->data; | ||
448 | + gchar *tag_name; | ||
449 | + | ||
450 | + /* Add it to the tag hash table */ | ||
451 | + g_hash_table_insert (context->tags, tag, tag); | ||
452 | + | ||
453 | + tag_name = g_markup_escape_text (tag->name, -1); | ||
454 | + | ||
455 | + g_string_append_printf (context->text_str, "<apply_tag name=\"%s\">", tag_name); | ||
456 | + g_free (tag_name); | ||
457 | + | ||
458 | + g_queue_push_head (active_tags, tag); | ||
459 | + | ||
460 | + tmp = tmp->next; | ||
461 | + } | ||
462 | + | ||
463 | + g_slist_free (tag_list); | ||
464 | + tag_list = new_tag_list; | ||
465 | + | ||
466 | + old_iter = iter; | ||
467 | + | ||
468 | + /* Now try to go to either the next tag toggle, or if a pixbuf appears */ | ||
469 | + while (TRUE) | ||
470 | + { | ||
471 | + gunichar ch = gtk_text_iter_get_char (&iter); | ||
472 | + | ||
473 | + if (ch == 0xFFFC) | ||
474 | + { | ||
475 | + GdkPixbuf *pixbuf = gtk_text_iter_get_pixbuf (&iter); | ||
476 | + | ||
477 | + if (pixbuf) { | ||
478 | + g_string_append_printf (context->text_str, "<pixbuf index=\"%d\" />", context->n_pixbufs); | ||
479 | + | ||
480 | + context->n_pixbufs++; | ||
481 | + context->pixbufs = g_list_prepend (context->pixbufs, pixbuf); | ||
482 | + } | ||
483 | + } | ||
484 | + | ||
485 | + gtk_text_iter_forward_char (&iter); | ||
486 | + | ||
487 | + if (gtk_text_iter_toggles_tag (&iter, NULL)) | ||
488 | + break; | ||
489 | + } | ||
490 | + | ||
491 | + /* We might have moved too far */ | ||
492 | + if (gtk_text_iter_compare (&iter, &context->end) > 0) | ||
493 | + iter = context->end; | ||
494 | + | ||
495 | + /* Append the text */ | ||
496 | + tmp_text = gtk_text_iter_get_slice (&old_iter, &iter); | ||
497 | + escaped_text = g_markup_escape_text (tmp_text, -1); | ||
498 | + g_free (tmp_text); | ||
499 | + | ||
500 | + g_string_append (context->text_str, escaped_text); | ||
501 | + g_free (escaped_text); | ||
502 | + } | ||
503 | + while (!gtk_text_iter_equal (&iter, &context->end)); | ||
504 | + | ||
505 | + /* Close any open tags */ | ||
506 | + for (i = 0; i < g_queue_get_length (active_tags); i++) { | ||
507 | + g_string_append (context->text_str, "</apply_tag>"); | ||
508 | + } | ||
509 | + g_queue_free (active_tags); | ||
510 | + g_string_append (context->text_str, "</text>\n</text_view_markup>\n"); | ||
511 | +} | ||
512 | + | ||
513 | +static void | ||
514 | +serialize_pixbufs (SerializationContext *context, | ||
515 | + GString *text) | ||
516 | +{ | ||
517 | + GList *list; | ||
518 | + | ||
519 | + for (list = context->pixbufs; list != NULL; list = list->next) | ||
520 | + { | ||
521 | + GdkPixbuf *pixbuf = list->data; | ||
522 | + GdkPixdata pixdata; | ||
523 | + guint8 *tmp; | ||
524 | + guint len; | ||
525 | + | ||
526 | + gdk_pixdata_from_pixbuf (&pixdata, pixbuf, FALSE); | ||
527 | + tmp = gdk_pixdata_serialize (&pixdata, &len); | ||
528 | + | ||
529 | + serialize_section_header (text, "PDPIXBUF", len); | ||
530 | + g_string_append_len (text, tmp, len); | ||
531 | + g_free (tmp); | ||
532 | + } | ||
533 | +} | ||
534 | + | ||
535 | +gchar * | ||
536 | +gtk_text_buffer_serialize_rich_text (GtkTextBuffer *buffer, | ||
537 | + const GtkTextIter *start, | ||
538 | + const GtkTextIter *end, | ||
539 | + gint *len) | ||
540 | +{ | ||
541 | + SerializationContext context; | ||
542 | + GString *text; | ||
543 | + | ||
544 | + context.tags = g_hash_table_new (NULL, NULL); | ||
545 | + context.text_str = g_string_new (NULL); | ||
546 | + context.tag_table_str = g_string_new (NULL); | ||
547 | + context.start = *start; | ||
548 | + context.end = *end; | ||
549 | + context.n_pixbufs = 0; | ||
550 | + context.pixbufs = NULL; | ||
551 | + | ||
552 | + /* We need to serialize the text before the tag table so we know | ||
553 | + what tags are used */ | ||
554 | + serialize_text (buffer, &context); | ||
555 | + serialize_tags (&context); | ||
556 | + | ||
557 | + text = g_string_new (NULL); | ||
558 | + serialize_section_header (text, "RICHTEXT", context.tag_table_str->len + context.text_str->len); | ||
559 | + | ||
560 | + g_print ("when serializing length is: %d\n", context.tag_table_str->len + context.text_str->len); | ||
561 | + | ||
562 | + g_string_append_len (text, context.tag_table_str->str, context.tag_table_str->len); | ||
563 | + g_string_append_len (text, context.text_str->str, context.text_str->len); | ||
564 | + | ||
565 | + context.pixbufs = g_list_reverse (context.pixbufs); | ||
566 | + serialize_pixbufs (&context, text); | ||
567 | + | ||
568 | + g_hash_table_destroy (context.tags); | ||
569 | + g_list_free (context.pixbufs); | ||
570 | + g_string_free (context.text_str, TRUE); | ||
571 | + g_string_free (context.tag_table_str, TRUE); | ||
572 | + | ||
573 | + *len = text->len; | ||
574 | + | ||
575 | + return g_string_free (text, FALSE); | ||
576 | +} | ||
577 | + | ||
578 | +typedef enum | ||
579 | +{ | ||
580 | + STATE_START, | ||
581 | + STATE_TEXT_VIEW_MARKUP, | ||
582 | + STATE_TAGS, | ||
583 | + STATE_TAG, | ||
584 | + STATE_ATTR, | ||
585 | + STATE_TEXT, | ||
586 | + STATE_APPLY_TAG, | ||
587 | + STATE_PIXBUF | ||
588 | +} ParseState; | ||
589 | + | ||
590 | +typedef struct | ||
591 | +{ | ||
592 | + gchar *text; | ||
593 | + GdkPixbuf *pixbuf; | ||
594 | + GSList *tags; | ||
595 | +} TextSpan; | ||
596 | + | ||
597 | +typedef struct | ||
598 | +{ | ||
599 | + GtkTextTag *tag; | ||
600 | + gint prio; | ||
601 | +} TextTagPrio; | ||
602 | + | ||
603 | +typedef struct | ||
604 | +{ | ||
605 | + GSList *states; | ||
606 | + | ||
607 | + GList *headers; | ||
608 | + | ||
609 | + GtkTextBuffer *buffer; | ||
610 | + | ||
611 | + /* Tags that are defined in <tag> elements */ | ||
612 | + GHashTable *defined_tags; | ||
613 | + | ||
614 | + /* Tag name substitutions */ | ||
615 | + GHashTable *substitutions; | ||
616 | + | ||
617 | + /* Current tag */ | ||
618 | + GtkTextTag *current_tag; | ||
619 | + | ||
620 | + /* Priority of current tag */ | ||
621 | + gint current_tag_prio; | ||
622 | + | ||
623 | + /* Tags and their priorities */ | ||
624 | + GList *tag_priorities; | ||
625 | + | ||
626 | + GSList *tag_stack; | ||
627 | + | ||
628 | + GList *spans; | ||
629 | + | ||
630 | + gboolean create_tags; | ||
631 | + | ||
632 | + gboolean parsed_text; | ||
633 | + gboolean parsed_tags; | ||
634 | +} ParseInfo; | ||
635 | + | ||
636 | +static void | ||
637 | +set_error (GError **err, | ||
638 | + GMarkupParseContext *context, | ||
639 | + int error_domain, | ||
640 | + int error_code, | ||
641 | + const char *format, | ||
642 | + ...) | ||
643 | +{ | ||
644 | + int line, ch; | ||
645 | + va_list args; | ||
646 | + char *str; | ||
647 | + | ||
648 | + g_markup_parse_context_get_position (context, &line, &ch); | ||
649 | + | ||
650 | + va_start (args, format); | ||
651 | + str = g_strdup_vprintf (format, args); | ||
652 | + va_end (args); | ||
653 | + | ||
654 | + g_set_error (err, error_domain, error_code, | ||
655 | + ("Line %d character %d: %s"), | ||
656 | + line, ch, str); | ||
657 | + | ||
658 | + g_free (str); | ||
659 | +} | ||
660 | + | ||
661 | +static void | ||
662 | +push_state (ParseInfo *info, | ||
663 | + ParseState state) | ||
664 | +{ | ||
665 | + info->states = g_slist_prepend (info->states, GINT_TO_POINTER (state)); | ||
666 | +} | ||
667 | + | ||
668 | +static void | ||
669 | +pop_state (ParseInfo *info) | ||
670 | +{ | ||
671 | + g_return_if_fail (info->states != NULL); | ||
672 | + | ||
673 | + info->states = g_slist_remove (info->states, info->states->data); | ||
674 | +} | ||
675 | + | ||
676 | +static ParseState | ||
677 | +peek_state (ParseInfo *info) | ||
678 | +{ | ||
679 | + g_return_val_if_fail (info->states != NULL, STATE_START); | ||
680 | + | ||
681 | + return GPOINTER_TO_INT (info->states->data); | ||
682 | +} | ||
683 | + | ||
684 | +#define ELEMENT_IS(name) (strcmp (element_name, (name)) == 0) | ||
685 | + | ||
686 | +typedef struct | ||
687 | +{ | ||
688 | + const char *name; | ||
689 | + const char **retloc; | ||
690 | +} LocateAttr; | ||
691 | + | ||
692 | +static gboolean | ||
693 | +locate_attributes (GMarkupParseContext *context, | ||
694 | + const char *element_name, | ||
695 | + const char **attribute_names, | ||
696 | + const char **attribute_values, | ||
697 | + GError **error, | ||
698 | + const char *first_attribute_name, | ||
699 | + const char **first_attribute_retloc, | ||
700 | + ...) | ||
701 | +{ | ||
702 | + va_list args; | ||
703 | + const char *name; | ||
704 | + const char **retloc; | ||
705 | + int n_attrs; | ||
706 | +#define MAX_ATTRS 24 | ||
707 | + LocateAttr attrs[MAX_ATTRS]; | ||
708 | + gboolean retval; | ||
709 | + int i; | ||
710 | + | ||
711 | + g_return_val_if_fail (first_attribute_name != NULL, FALSE); | ||
712 | + g_return_val_if_fail (first_attribute_retloc != NULL, FALSE); | ||
713 | + | ||
714 | + retval = TRUE; | ||
715 | + | ||
716 | + n_attrs = 1; | ||
717 | + attrs[0].name = first_attribute_name; | ||
718 | + attrs[0].retloc = first_attribute_retloc; | ||
719 | + *first_attribute_retloc = NULL; | ||
720 | + | ||
721 | + va_start (args, first_attribute_retloc); | ||
722 | + | ||
723 | + name = va_arg (args, const char*); | ||
724 | + retloc = va_arg (args, const char**); | ||
725 | + | ||
726 | + while (name != NULL) | ||
727 | + { | ||
728 | + g_return_val_if_fail (retloc != NULL, FALSE); | ||
729 | + | ||
730 | + g_assert (n_attrs < MAX_ATTRS); | ||
731 | + | ||
732 | + attrs[n_attrs].name = name; | ||
733 | + attrs[n_attrs].retloc = retloc; | ||
734 | + n_attrs += 1; | ||
735 | + *retloc = NULL; | ||
736 | + | ||
737 | + name = va_arg (args, const char*); | ||
738 | + retloc = va_arg (args, const char**); | ||
739 | + } | ||
740 | + | ||
741 | + va_end (args); | ||
742 | + | ||
743 | + if (!retval) | ||
744 | + return retval; | ||
745 | + | ||
746 | + i = 0; | ||
747 | + while (attribute_names[i]) | ||
748 | + { | ||
749 | + int j; | ||
750 | + gboolean found; | ||
751 | + | ||
752 | + found = FALSE; | ||
753 | + j = 0; | ||
754 | + while (j < n_attrs) | ||
755 | + { | ||
756 | + if (strcmp (attrs[j].name, attribute_names[i]) == 0) | ||
757 | + { | ||
758 | + retloc = attrs[j].retloc; | ||
759 | + | ||
760 | + if (*retloc != NULL) | ||
761 | + { | ||
762 | + set_error (error, context, | ||
763 | + G_MARKUP_ERROR, | ||
764 | + G_MARKUP_ERROR_PARSE, | ||
765 | + _("Attribute \"%s\" repeated twice on the same <%s> element"), | ||
766 | + attrs[j].name, element_name); | ||
767 | + retval = FALSE; | ||
768 | + goto out; | ||
769 | + } | ||
770 | + | ||
771 | + *retloc = attribute_values[i]; | ||
772 | + found = TRUE; | ||
773 | + } | ||
774 | + | ||
775 | + ++j; | ||
776 | + } | ||
777 | + | ||
778 | + if (!found) | ||
779 | + { | ||
780 | + set_error (error, context, | ||
781 | + G_MARKUP_ERROR, | ||
782 | + G_MARKUP_ERROR_PARSE, | ||
783 | + _("Attribute \"%s\" is invalid on <%s> element in this context"), | ||
784 | + attribute_names[i], element_name); | ||
785 | + retval = FALSE; | ||
786 | + goto out; | ||
787 | + } | ||
788 | + | ||
789 | + ++i; | ||
790 | + } | ||
791 | + | ||
792 | + out: | ||
793 | + return retval; | ||
794 | +} | ||
795 | + | ||
796 | +static gboolean | ||
797 | +check_no_attributes (GMarkupParseContext *context, | ||
798 | + const char *element_name, | ||
799 | + const char **attribute_names, | ||
800 | + const char **attribute_values, | ||
801 | + GError **error) | ||
802 | +{ | ||
803 | + if (attribute_names[0] != NULL) | ||
804 | + { | ||
805 | + set_error (error, context, | ||
806 | + G_MARKUP_ERROR, | ||
807 | + G_MARKUP_ERROR_PARSE, | ||
808 | + _("Attribute \"%s\" is invalid on <%s> element in this context"), | ||
809 | + attribute_names[0], element_name); | ||
810 | + return FALSE; | ||
811 | + } | ||
812 | + | ||
813 | + return TRUE; | ||
814 | +} | ||
815 | + | ||
816 | +static const gchar * | ||
817 | +tag_exists (GMarkupParseContext *context, | ||
818 | + const gchar *name, | ||
819 | + ParseInfo *info, | ||
820 | + GError **error) | ||
821 | +{ | ||
822 | + const gchar *real_name; | ||
823 | + | ||
824 | + if (info->create_tags) | ||
825 | + { | ||
826 | + /* First, try the substitutions */ | ||
827 | + real_name = g_hash_table_lookup (info->substitutions, name); | ||
828 | + | ||
829 | + if (real_name) | ||
830 | + return real_name; | ||
831 | + | ||
832 | + /* Next, try the list of defined tags */ | ||
833 | + if (g_hash_table_lookup (info->defined_tags, name) != NULL) | ||
834 | + return name; | ||
835 | + | ||
836 | + set_error (error, context, | ||
837 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
838 | + _("Tag \"%s\" has not been defined."), name); | ||
839 | + | ||
840 | + return NULL; | ||
841 | + } | ||
842 | + else | ||
843 | + { | ||
844 | + if (gtk_text_tag_table_lookup (info->buffer->tag_table, name) != NULL) | ||
845 | + return name; | ||
846 | + | ||
847 | + set_error (error, context, | ||
848 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
849 | + _("Tag \"%s\" does not exist in buffer and tags can not be created."), name); | ||
850 | + | ||
851 | + return NULL; | ||
852 | + } | ||
853 | +} | ||
854 | + | ||
855 | +typedef struct | ||
856 | +{ | ||
857 | + const gchar *id; | ||
858 | + gint length; | ||
859 | + const gchar *start; | ||
860 | +} Header; | ||
861 | + | ||
862 | +static GdkPixbuf * | ||
863 | +get_pixbuf_from_headers (GList *headers, int id, GError **error) | ||
864 | +{ | ||
865 | + Header *header; | ||
866 | + GdkPixdata pixdata; | ||
867 | + GdkPixbuf *pixbuf; | ||
868 | + | ||
869 | + header = g_list_nth_data (headers, id); | ||
870 | + | ||
871 | + if (!header) | ||
872 | + return NULL; | ||
873 | + | ||
874 | + if (!gdk_pixdata_deserialize (&pixdata, header->length, header->start, error)) | ||
875 | + return NULL; | ||
876 | + | ||
877 | + pixbuf = gdk_pixbuf_from_pixdata (&pixdata, TRUE, error); | ||
878 | + | ||
879 | + g_print ("pixbuf is: %p\n", pixbuf); | ||
880 | + | ||
881 | + return pixbuf; | ||
882 | +} | ||
883 | + | ||
884 | +static void | ||
885 | +parse_apply_tag_element (GMarkupParseContext *context, | ||
886 | + const gchar *element_name, | ||
887 | + const gchar **attribute_names, | ||
888 | + const gchar **attribute_values, | ||
889 | + ParseInfo *info, | ||
890 | + GError **error) | ||
891 | +{ | ||
892 | + const gchar *name, *tag_name, *id; | ||
893 | + | ||
894 | + g_assert (peek_state (info) == STATE_TEXT || | ||
895 | + peek_state (info) == STATE_APPLY_TAG); | ||
896 | + | ||
897 | + if (ELEMENT_IS ("apply_tag")) | ||
898 | + { | ||
899 | + if (!locate_attributes (context, element_name, attribute_names, attribute_values, error, | ||
900 | + "name", &name, NULL)) | ||
901 | + return; | ||
902 | + | ||
903 | + tag_name = tag_exists (context, name, info, error); | ||
904 | + | ||
905 | + if (!tag_name) | ||
906 | + return; | ||
907 | + | ||
908 | + info->tag_stack = g_slist_prepend (info->tag_stack, g_strdup (tag_name)); | ||
909 | + | ||
910 | + push_state (info, STATE_APPLY_TAG); | ||
911 | + } | ||
912 | + else if (ELEMENT_IS ("pixbuf")) | ||
913 | + { | ||
914 | + int int_id; | ||
915 | + GdkPixbuf *pixbuf; | ||
916 | + TextSpan *span; | ||
917 | + | ||
918 | + if (!locate_attributes (context, element_name, attribute_names, attribute_values, error, | ||
919 | + "index", &id, NULL)) | ||
920 | + return; | ||
921 | + | ||
922 | + int_id = atoi (id); | ||
923 | + pixbuf = get_pixbuf_from_headers (info->headers, int_id, error); | ||
924 | + | ||
925 | + span = g_new0 (TextSpan, 1); | ||
926 | + span->pixbuf = pixbuf; | ||
927 | + span->tags = NULL; | ||
928 | + | ||
929 | + info->spans = g_list_prepend (info->spans, span); | ||
930 | + | ||
931 | + if (!pixbuf) | ||
932 | + return; | ||
933 | + | ||
934 | + push_state (info, STATE_PIXBUF); | ||
935 | + } | ||
936 | + else | ||
937 | + set_error (error, context, | ||
938 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
939 | + _("Element <%s> is not allowed below <%s>"), | ||
940 | + element_name, peek_state(info) == STATE_TEXT ? "text" : "apply_tag"); | ||
941 | +} | ||
942 | + | ||
943 | +static void | ||
944 | +parse_attr_element (GMarkupParseContext *context, | ||
945 | + const gchar *element_name, | ||
946 | + const gchar **attribute_names, | ||
947 | + const gchar **attribute_values, | ||
948 | + ParseInfo *info, | ||
949 | + GError **error) | ||
950 | +{ | ||
951 | + const gchar *name, *type, *value; | ||
952 | + GType gtype; | ||
953 | + GValue gvalue = { 0 }; | ||
954 | + GParamSpec *pspec; | ||
955 | + | ||
956 | + g_assert (peek_state (info) == STATE_TAG); | ||
957 | + | ||
958 | + if (ELEMENT_IS ("attr")) | ||
959 | + { | ||
960 | + if (!locate_attributes (context, element_name, attribute_names, attribute_values, error, | ||
961 | + "name", &name, "type", &type, "value", &value, NULL)) | ||
962 | + return; | ||
963 | + | ||
964 | + gtype = g_type_from_name (type); | ||
965 | + | ||
966 | + if (gtype == G_TYPE_INVALID) | ||
967 | + { | ||
968 | + set_error (error, context, | ||
969 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
970 | + _("\"%s\" is not a valid attribute type"), type); | ||
971 | + return; | ||
972 | + } | ||
973 | + | ||
974 | + if (!(pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (info->current_tag), name))) | ||
975 | + { | ||
976 | + set_error (error, context, | ||
977 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
978 | + _("\"%s\" is not a valid attribute name"), name); | ||
979 | + return; | ||
980 | + } | ||
981 | + | ||
982 | + g_value_init (&gvalue, gtype); | ||
983 | + | ||
984 | + if (!deserialize_value (value, &gvalue)) | ||
985 | + { | ||
986 | + set_error (error, context, | ||
987 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
988 | + _("\"%s\" could not be converted to a value of type \"%s\" for attribute \"%s\""), | ||
989 | + value, type, name); | ||
990 | + return; | ||
991 | + } | ||
992 | + | ||
993 | + if (g_param_value_validate (pspec, &gvalue)) | ||
994 | + { | ||
995 | + set_error (error, context, | ||
996 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
997 | + _("\"%s\" is not a valid value of for attribute \"%s\""), | ||
998 | + value, name); | ||
999 | + g_value_unset (&gvalue); | ||
1000 | + return; | ||
1001 | + } | ||
1002 | + | ||
1003 | + g_object_set_property (G_OBJECT (info->current_tag), | ||
1004 | + name, &gvalue); | ||
1005 | + | ||
1006 | + g_value_unset (&gvalue); | ||
1007 | + | ||
1008 | + push_state (info, STATE_ATTR); | ||
1009 | + } | ||
1010 | + else | ||
1011 | + { | ||
1012 | + set_error (error, context, | ||
1013 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1014 | + _("Element <%s> is not allowed below <%s>"), | ||
1015 | + element_name, "tag"); | ||
1016 | + } | ||
1017 | +} | ||
1018 | + | ||
1019 | + | ||
1020 | +static gchar * | ||
1021 | +get_tag_name (ParseInfo *info, | ||
1022 | + const gchar *tag_name) | ||
1023 | +{ | ||
1024 | + gchar *name; | ||
1025 | + gint i; | ||
1026 | + | ||
1027 | + name = g_strdup (tag_name); | ||
1028 | + | ||
1029 | + if (!info->create_tags) | ||
1030 | + return name; | ||
1031 | + | ||
1032 | + i = 0; | ||
1033 | + | ||
1034 | + while (gtk_text_tag_table_lookup (info->buffer->tag_table, name) != NULL) | ||
1035 | + { | ||
1036 | + g_free (name); | ||
1037 | + name = g_strdup_printf ("%s-%d", tag_name, ++i); | ||
1038 | + } | ||
1039 | + | ||
1040 | + if (i != 0) | ||
1041 | + { | ||
1042 | + g_hash_table_insert (info->substitutions, g_strdup (tag_name), g_strdup (name)); | ||
1043 | + } | ||
1044 | + | ||
1045 | + return name; | ||
1046 | +} | ||
1047 | + | ||
1048 | +static void | ||
1049 | +parse_tag_element (GMarkupParseContext *context, | ||
1050 | + const gchar *element_name, | ||
1051 | + const gchar **attribute_names, | ||
1052 | + const gchar **attribute_values, | ||
1053 | + ParseInfo *info, | ||
1054 | + GError **error) | ||
1055 | +{ | ||
1056 | + const gchar *name, *priority; | ||
1057 | + gchar *tag_name; | ||
1058 | + gint prio; | ||
1059 | + gchar *tmp; | ||
1060 | + | ||
1061 | + g_assert (peek_state (info) == STATE_TAGS); | ||
1062 | + | ||
1063 | + if (ELEMENT_IS ("tag")) | ||
1064 | + { | ||
1065 | + if (!locate_attributes (context, element_name, attribute_names, attribute_values, error, | ||
1066 | + "name", &name, "priority", &priority, NULL)) | ||
1067 | + return; | ||
1068 | + | ||
1069 | + if (g_hash_table_lookup (info->defined_tags, name) != NULL) | ||
1070 | + { | ||
1071 | + set_error (error, context, | ||
1072 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1073 | + _("Tag \"%s\" already defined"), name); | ||
1074 | + return; | ||
1075 | + } | ||
1076 | + | ||
1077 | + prio = strtol (priority, &tmp, 10); | ||
1078 | + | ||
1079 | + if (tmp == NULL || tmp == priority) | ||
1080 | + { | ||
1081 | + set_error (error, context, | ||
1082 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1083 | + _("Tag \"%s\" has invalid priority \"%s\""), name, priority); | ||
1084 | + return; | ||
1085 | + } | ||
1086 | + | ||
1087 | + tag_name = get_tag_name (info, name); | ||
1088 | + info->current_tag = gtk_text_tag_new (tag_name); | ||
1089 | + info->current_tag_prio = prio; | ||
1090 | + | ||
1091 | + g_free (tag_name); | ||
1092 | + | ||
1093 | + push_state (info, STATE_TAG); | ||
1094 | + } | ||
1095 | + else | ||
1096 | + { | ||
1097 | + set_error (error, context, | ||
1098 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1099 | + _("Element <%s> is not allowed below <%s>"), | ||
1100 | + element_name, "tags"); | ||
1101 | + } | ||
1102 | +} | ||
1103 | + | ||
1104 | +static void | ||
1105 | +start_element_handler (GMarkupParseContext *context, | ||
1106 | + const gchar *element_name, | ||
1107 | + const gchar **attribute_names, | ||
1108 | + const gchar **attribute_values, | ||
1109 | + gpointer user_data, | ||
1110 | + GError **error) | ||
1111 | +{ | ||
1112 | + ParseInfo *info = user_data; | ||
1113 | + | ||
1114 | + switch (peek_state (info)) | ||
1115 | + { | ||
1116 | + case STATE_START: | ||
1117 | + if (ELEMENT_IS ("text_view_markup")) | ||
1118 | + { | ||
1119 | + if (!check_no_attributes (context, element_name, | ||
1120 | + attribute_names, attribute_values, error)) | ||
1121 | + return; | ||
1122 | + | ||
1123 | + push_state (info, STATE_TEXT_VIEW_MARKUP); | ||
1124 | + break; | ||
1125 | + } | ||
1126 | + else | ||
1127 | + set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1128 | + _("Outermost element in text must be <text_view_markup> not <%s>"), | ||
1129 | + element_name); | ||
1130 | + break; | ||
1131 | + case STATE_TEXT_VIEW_MARKUP: | ||
1132 | + if (ELEMENT_IS ("tags")) | ||
1133 | + { | ||
1134 | + if (info->parsed_tags) | ||
1135 | + { | ||
1136 | + set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1137 | + _("A <tags> element has already been specified")); | ||
1138 | + return; | ||
1139 | + } | ||
1140 | + | ||
1141 | + if (!check_no_attributes (context, element_name, | ||
1142 | + attribute_names, attribute_values, error)) | ||
1143 | + return; | ||
1144 | + | ||
1145 | + push_state (info, STATE_TAGS); | ||
1146 | + break; | ||
1147 | + } | ||
1148 | + else if (ELEMENT_IS ("text")) | ||
1149 | + { | ||
1150 | + if (info->parsed_text) | ||
1151 | + { | ||
1152 | + set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1153 | + _("A <text> element has already been specified")); | ||
1154 | + return; | ||
1155 | + } | ||
1156 | + else if (!info->parsed_tags) | ||
1157 | + { | ||
1158 | + set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1159 | + _("A <text> element can't occur before a <tags> element")); | ||
1160 | + return; | ||
1161 | + } | ||
1162 | + | ||
1163 | + if (!check_no_attributes (context, element_name, | ||
1164 | + attribute_names, attribute_values, error)) | ||
1165 | + return; | ||
1166 | + | ||
1167 | + push_state (info, STATE_TEXT); | ||
1168 | + break; | ||
1169 | + } | ||
1170 | + else | ||
1171 | + set_error (error, context, | ||
1172 | + G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, | ||
1173 | + _("Element <%s> is not allowed below <%s>"), | ||
1174 | + element_name, "text_view_markup"); | ||
1175 | + break; | ||
1176 | + case STATE_TAGS: | ||
1177 | + parse_tag_element (context, element_name, | ||
1178 | + attribute_names, attribute_values, | ||
1179 | + info, error); | ||
1180 | + break; | ||
1181 | + case STATE_TAG: | ||
1182 | + parse_attr_element (context, element_name, | ||
1183 | + attribute_names, attribute_values, | ||
1184 | + info, error); | ||
1185 | + break; | ||
1186 | + case STATE_TEXT: | ||
1187 | + case STATE_APPLY_TAG: | ||
1188 | + parse_apply_tag_element (context, element_name, | ||
1189 | + attribute_names, attribute_values, | ||
1190 | + info, error); | ||
1191 | + break; | ||
1192 | + default: | ||
1193 | + g_assert_not_reached (); | ||
1194 | + break; | ||
1195 | + } | ||
1196 | +} | ||
1197 | + | ||
1198 | +static gint | ||
1199 | +sort_tag_prio (TextTagPrio *a, | ||
1200 | + TextTagPrio *b) | ||
1201 | +{ | ||
1202 | + if (a->prio < b->prio) | ||
1203 | + return -1; | ||
1204 | + else if (a->prio > b->prio) | ||
1205 | + return 1; | ||
1206 | + else | ||
1207 | + return 0; | ||
1208 | +} | ||
1209 | + | ||
1210 | +static void | ||
1211 | +end_element_handler (GMarkupParseContext *context, | ||
1212 | + const gchar *element_name, | ||
1213 | + gpointer user_data, | ||
1214 | + GError **error) | ||
1215 | +{ | ||
1216 | + ParseInfo *info = user_data; | ||
1217 | + gchar *tmp; | ||
1218 | + GList *list; | ||
1219 | + | ||
1220 | + switch (peek_state (info)) | ||
1221 | + { | ||
1222 | + case STATE_TAGS: | ||
1223 | + pop_state (info); | ||
1224 | + g_assert (peek_state (info) == STATE_TEXT_VIEW_MARKUP); | ||
1225 | + | ||
1226 | + info->parsed_tags = TRUE; | ||
1227 | + | ||
1228 | + /* Sort list and add the tags */ | ||
1229 | + info->tag_priorities = g_list_sort (info->tag_priorities, | ||
1230 | + (GCompareFunc)sort_tag_prio); | ||
1231 | + list = info->tag_priorities; | ||
1232 | + while (list) | ||
1233 | + { | ||
1234 | + TextTagPrio *prio = list->data; | ||
1235 | + | ||
1236 | + if (info->create_tags) | ||
1237 | + gtk_text_tag_table_add (info->buffer->tag_table, prio->tag); | ||
1238 | + | ||
1239 | + g_object_unref (prio->tag); | ||
1240 | + prio->tag = NULL; | ||
1241 | + | ||
1242 | + list = list->next; | ||
1243 | + } | ||
1244 | + | ||
1245 | + break; | ||
1246 | + case STATE_TAG: | ||
1247 | + pop_state (info); | ||
1248 | + g_assert (peek_state (info) == STATE_TAGS); | ||
1249 | + | ||
1250 | + /* Add tag to defined tags hash */ | ||
1251 | + tmp = g_strdup (info->current_tag->name); | ||
1252 | + g_hash_table_insert (info->defined_tags, | ||
1253 | + tmp, tmp); | ||
1254 | + | ||
1255 | + if (info->create_tags) | ||
1256 | + { | ||
1257 | + TextTagPrio *prio; | ||
1258 | + | ||
1259 | + /* add the tag to the list */ | ||
1260 | + prio = g_new0 (TextTagPrio, 1); | ||
1261 | + prio->prio = info->current_tag_prio; | ||
1262 | + prio->tag = info->current_tag; | ||
1263 | + | ||
1264 | + info->tag_priorities = g_list_prepend (info->tag_priorities, prio); | ||
1265 | + } | ||
1266 | + | ||
1267 | + info->current_tag = NULL; | ||
1268 | + break; | ||
1269 | + case STATE_ATTR: | ||
1270 | + pop_state (info); | ||
1271 | + g_assert (peek_state (info) == STATE_TAG); | ||
1272 | + break; | ||
1273 | + case STATE_APPLY_TAG: | ||
1274 | + pop_state (info); | ||
1275 | + g_assert (peek_state (info) == STATE_APPLY_TAG || | ||
1276 | + peek_state (info) == STATE_TEXT); | ||
1277 | + | ||
1278 | + /* Pop tag */ | ||
1279 | + g_free (info->tag_stack->data); | ||
1280 | + info->tag_stack = g_slist_delete_link (info->tag_stack, | ||
1281 | + info->tag_stack); | ||
1282 | + | ||
1283 | + break; | ||
1284 | + case STATE_TEXT: | ||
1285 | + pop_state (info); | ||
1286 | + g_assert (peek_state (info) == STATE_TEXT_VIEW_MARKUP); | ||
1287 | + | ||
1288 | + info->spans = g_list_reverse (info->spans); | ||
1289 | + info->parsed_text = TRUE; | ||
1290 | + break; | ||
1291 | + case STATE_TEXT_VIEW_MARKUP: | ||
1292 | + pop_state (info); | ||
1293 | + g_assert (peek_state (info) == STATE_START); | ||
1294 | + break; | ||
1295 | + case STATE_PIXBUF: | ||
1296 | + pop_state (info); | ||
1297 | + g_assert (peek_state (info) == STATE_APPLY_TAG || | ||
1298 | + peek_state (info) == STATE_TEXT); | ||
1299 | + break; | ||
1300 | + default: | ||
1301 | + g_assert_not_reached (); | ||
1302 | + break; | ||
1303 | + } | ||
1304 | +} | ||
1305 | + | ||
1306 | +static gboolean | ||
1307 | +all_whitespace (const char *text, | ||
1308 | + int text_len) | ||
1309 | +{ | ||
1310 | + const char *p; | ||
1311 | + const char *end; | ||
1312 | + | ||
1313 | + p = text; | ||
1314 | + end = text + text_len; | ||
1315 | + | ||
1316 | + while (p != end) | ||
1317 | + { | ||
1318 | + if (!g_ascii_isspace (*p)) | ||
1319 | + return FALSE; | ||
1320 | + | ||
1321 | + p = g_utf8_next_char (p); | ||
1322 | + } | ||
1323 | + | ||
1324 | + return TRUE; | ||
1325 | +} | ||
1326 | + | ||
1327 | +static GSList * | ||
1328 | +copy_tag_list (GSList *tag_list) | ||
1329 | +{ | ||
1330 | + GSList *tmp = NULL; | ||
1331 | + | ||
1332 | + while (tag_list) | ||
1333 | + { | ||
1334 | + tmp = g_slist_prepend (tmp, g_strdup (tag_list->data)); | ||
1335 | + | ||
1336 | + tag_list = tag_list->next; | ||
1337 | + } | ||
1338 | + | ||
1339 | + return tmp; | ||
1340 | +} | ||
1341 | + | ||
1342 | +static void | ||
1343 | +text_handler (GMarkupParseContext *context, | ||
1344 | + const gchar *text, | ||
1345 | + gsize text_len, | ||
1346 | + gpointer user_data, | ||
1347 | + GError **error) | ||
1348 | +{ | ||
1349 | + ParseInfo *info = user_data; | ||
1350 | + TextSpan *span; | ||
1351 | + | ||
1352 | + if (all_whitespace (text, text_len) && | ||
1353 | + peek_state (info) != STATE_TEXT && | ||
1354 | + peek_state (info) != STATE_APPLY_TAG) | ||
1355 | + return; | ||
1356 | + | ||
1357 | + switch (peek_state (info)) | ||
1358 | + { | ||
1359 | + case STATE_START: | ||
1360 | + g_assert_not_reached (); /* gmarkup shouldn't do this */ | ||
1361 | + break; | ||
1362 | + case STATE_TEXT: | ||
1363 | + case STATE_APPLY_TAG: | ||
1364 | + if (text_len == 0) | ||
1365 | + return; | ||
1366 | + | ||
1367 | + span = g_new0 (TextSpan, 1); | ||
1368 | + span->text = g_strndup (text, text_len); | ||
1369 | + span->tags = copy_tag_list (info->tag_stack); | ||
1370 | + | ||
1371 | + info->spans = g_list_prepend (info->spans, span); | ||
1372 | + break; | ||
1373 | + default: | ||
1374 | + g_assert_not_reached (); | ||
1375 | + break; | ||
1376 | + } | ||
1377 | +} | ||
1378 | + | ||
1379 | +static void | ||
1380 | +parse_info_init (ParseInfo *info, | ||
1381 | + GtkTextBuffer *buffer, | ||
1382 | + gboolean create_tags, | ||
1383 | + GList *headers) | ||
1384 | +{ | ||
1385 | + info->states = g_slist_prepend (NULL, GINT_TO_POINTER (STATE_START)); | ||
1386 | + | ||
1387 | + info->create_tags = create_tags; | ||
1388 | + info->headers = headers; | ||
1389 | + info->defined_tags = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); | ||
1390 | + info->substitutions = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); | ||
1391 | + info->tag_stack = NULL; | ||
1392 | + info->spans = NULL; | ||
1393 | + info->parsed_text = FALSE; | ||
1394 | + info->parsed_tags = FALSE; | ||
1395 | + info->current_tag = NULL; | ||
1396 | + info->current_tag_prio = -1; | ||
1397 | + info->tag_priorities = NULL; | ||
1398 | + | ||
1399 | + info->buffer = buffer; | ||
1400 | +} | ||
1401 | + | ||
1402 | +static void | ||
1403 | +text_span_free (TextSpan *span) | ||
1404 | +{ | ||
1405 | + GSList *tmp; | ||
1406 | + | ||
1407 | + g_free (span->text); | ||
1408 | + | ||
1409 | + tmp = span->tags; | ||
1410 | + while (tmp) | ||
1411 | + { | ||
1412 | + g_free (tmp->data); | ||
1413 | + | ||
1414 | + tmp = tmp->next; | ||
1415 | + } | ||
1416 | + g_slist_free (span->tags); | ||
1417 | + g_free (span); | ||
1418 | +} | ||
1419 | + | ||
1420 | +static void | ||
1421 | +parse_info_free (ParseInfo *info) | ||
1422 | +{ | ||
1423 | + GSList *slist; | ||
1424 | + GList *list; | ||
1425 | + | ||
1426 | + slist = info->tag_stack; | ||
1427 | + while (slist) | ||
1428 | + { | ||
1429 | + g_free (slist->data); | ||
1430 | + | ||
1431 | + slist = slist->next; | ||
1432 | + } | ||
1433 | + | ||
1434 | + g_slist_free (info->tag_stack); | ||
1435 | + g_slist_free (info->states); | ||
1436 | + | ||
1437 | + g_hash_table_destroy (info->substitutions); | ||
1438 | + g_hash_table_destroy (info->defined_tags); | ||
1439 | + | ||
1440 | + if (info->current_tag) | ||
1441 | + g_object_unref (info->current_tag); | ||
1442 | + | ||
1443 | + list = info->spans; | ||
1444 | + while (list) | ||
1445 | + { | ||
1446 | + text_span_free (list->data); | ||
1447 | + | ||
1448 | + list = list->next; | ||
1449 | + } | ||
1450 | + g_list_free (info->spans); | ||
1451 | + | ||
1452 | + list = info->tag_priorities; | ||
1453 | + while (list) | ||
1454 | + { | ||
1455 | + TextTagPrio *prio = list->data; | ||
1456 | + | ||
1457 | + if (prio->tag) | ||
1458 | + g_object_unref (prio->tag); | ||
1459 | + g_free (prio); | ||
1460 | + | ||
1461 | + list = list->next; | ||
1462 | + } | ||
1463 | + g_list_free (info->tag_priorities); | ||
1464 | + | ||
1465 | +} | ||
1466 | + | ||
1467 | +static const gchar * | ||
1468 | +get_tag_substitution (ParseInfo *info, | ||
1469 | + const gchar *name) | ||
1470 | +{ | ||
1471 | + gchar *subst; | ||
1472 | + | ||
1473 | + if ((subst = g_hash_table_lookup (info->substitutions, name))) | ||
1474 | + return subst; | ||
1475 | + else | ||
1476 | + return name; | ||
1477 | +} | ||
1478 | + | ||
1479 | +static void | ||
1480 | +insert_text (ParseInfo *info, | ||
1481 | + GtkTextIter *iter) | ||
1482 | +{ | ||
1483 | + GtkTextIter start_iter; | ||
1484 | + GtkTextMark *mark; | ||
1485 | + GList *tmp; | ||
1486 | + GSList *tags; | ||
1487 | + | ||
1488 | + start_iter = *iter; | ||
1489 | + | ||
1490 | + mark = gtk_text_buffer_create_mark (info->buffer, "deserialize_insert_point", | ||
1491 | + &start_iter, TRUE); | ||
1492 | + | ||
1493 | + tmp = info->spans; | ||
1494 | + while (tmp) | ||
1495 | + { | ||
1496 | + TextSpan *span = tmp->data; | ||
1497 | + | ||
1498 | + if (span->text) | ||
1499 | + gtk_text_buffer_insert (info->buffer, iter, span->text, -1); | ||
1500 | + else | ||
1501 | + { | ||
1502 | + gtk_text_buffer_insert_pixbuf (info->buffer, iter, span->pixbuf); | ||
1503 | + g_object_unref (span->pixbuf); | ||
1504 | + } | ||
1505 | + gtk_text_buffer_get_iter_at_mark (info->buffer, &start_iter, mark); | ||
1506 | + | ||
1507 | + /* Apply tags */ | ||
1508 | + tags = span->tags; | ||
1509 | + while (tags) | ||
1510 | + { | ||
1511 | + const gchar *tag_name = get_tag_substitution (info, tags->data); | ||
1512 | + | ||
1513 | + gtk_text_buffer_apply_tag_by_name (info->buffer, tag_name, | ||
1514 | + &start_iter, iter); | ||
1515 | + | ||
1516 | + tags = tags->next; | ||
1517 | + } | ||
1518 | + | ||
1519 | + gtk_text_buffer_move_mark (info->buffer, mark, iter); | ||
1520 | + | ||
1521 | + tmp = tmp->next; | ||
1522 | + } | ||
1523 | + | ||
1524 | + gtk_text_buffer_delete_mark (info->buffer, mark); | ||
1525 | +} | ||
1526 | + | ||
1527 | + | ||
1528 | + | ||
1529 | +static int | ||
1530 | +read_int (const guchar *start) | ||
1531 | +{ | ||
1532 | + int result; | ||
1533 | + | ||
1534 | + result = | ||
1535 | + start[0] << 24 | | ||
1536 | + start[1] << 16 | | ||
1537 | + start[2] << 8 | | ||
1538 | + start[3]; | ||
1539 | + | ||
1540 | + return result; | ||
1541 | +} | ||
1542 | + | ||
1543 | +static gboolean | ||
1544 | +header_is (Header *header, const gchar *id) | ||
1545 | +{ | ||
1546 | + return (strncmp (header->id, id, 8) == 0); | ||
1547 | +} | ||
1548 | + | ||
1549 | +static GList * | ||
1550 | +read_headers (const gchar *start, | ||
1551 | + gint len, | ||
1552 | + GError **error) | ||
1553 | +{ | ||
1554 | + int i = 0; | ||
1555 | + int section_len; | ||
1556 | + Header *header; | ||
1557 | + GList *headers = NULL; | ||
1558 | + | ||
1559 | + while (i < len) | ||
1560 | + { | ||
1561 | + if (i + 12 >= len) | ||
1562 | + goto error; | ||
1563 | + | ||
1564 | + if (strncmp (start + i, "RICHTEXT", 8) == 0 || | ||
1565 | + strncmp (start + i, "PIXBDATA", 8) == 0) | ||
1566 | + { | ||
1567 | + | ||
1568 | + section_len = read_int (start + i + 8); | ||
1569 | + | ||
1570 | + if (i + 12 + section_len > len) | ||
1571 | + goto error; | ||
1572 | + | ||
1573 | + header = g_new0 (Header, 1); | ||
1574 | + header->id = start + i; | ||
1575 | + header->length = section_len; | ||
1576 | + header->start = start + i + 12; | ||
1577 | + | ||
1578 | + i += 12 + section_len; | ||
1579 | + | ||
1580 | + headers = g_list_prepend (headers, header); | ||
1581 | + } | ||
1582 | + else | ||
1583 | + break; | ||
1584 | + | ||
1585 | + } | ||
1586 | + | ||
1587 | + return g_list_reverse (headers); | ||
1588 | + | ||
1589 | + error: | ||
1590 | + g_list_foreach (headers, (GFunc) g_free, NULL); | ||
1591 | + g_list_free (headers); | ||
1592 | + | ||
1593 | + g_set_error (error, | ||
1594 | + G_MARKUP_ERROR, | ||
1595 | + G_MARKUP_ERROR_PARSE, | ||
1596 | + _("Serialized data is malformed")); | ||
1597 | + | ||
1598 | + return NULL; | ||
1599 | +} | ||
1600 | + | ||
1601 | +static gboolean | ||
1602 | +deserialize_text (GtkTextBuffer *buffer, | ||
1603 | + GtkTextIter *iter, | ||
1604 | + const gchar *text, | ||
1605 | + gint len, | ||
1606 | + gboolean create_tags, | ||
1607 | + GError **error, | ||
1608 | + GList *headers) | ||
1609 | +{ | ||
1610 | + GMarkupParseContext *context; | ||
1611 | + ParseInfo info; | ||
1612 | + gboolean retval = FALSE; | ||
1613 | + | ||
1614 | + | ||
1615 | + static GMarkupParser rich_text_parser = { | ||
1616 | + start_element_handler, | ||
1617 | + end_element_handler, | ||
1618 | + text_handler, | ||
1619 | + NULL, | ||
1620 | + NULL | ||
1621 | + }; | ||
1622 | + | ||
1623 | + parse_info_init (&info, buffer, create_tags, headers); | ||
1624 | + | ||
1625 | + context = g_markup_parse_context_new (&rich_text_parser, | ||
1626 | + 0, &info, NULL); | ||
1627 | + | ||
1628 | + if (!g_markup_parse_context_parse (context, | ||
1629 | + text, | ||
1630 | + len, | ||
1631 | + error)) | ||
1632 | + goto out; | ||
1633 | + | ||
1634 | + if (!g_markup_parse_context_end_parse (context, error)) | ||
1635 | + goto out; | ||
1636 | + | ||
1637 | + retval = TRUE; | ||
1638 | + | ||
1639 | + /* Now insert the text */ | ||
1640 | + insert_text (&info, iter); | ||
1641 | + | ||
1642 | + out: | ||
1643 | + parse_info_free (&info); | ||
1644 | + | ||
1645 | + g_markup_parse_context_free (context); | ||
1646 | + | ||
1647 | + return retval; | ||
1648 | +} | ||
1649 | + | ||
1650 | +gboolean | ||
1651 | +gtk_text_buffer_deserialize_rich_text (GtkTextBuffer *buffer, | ||
1652 | + GtkTextIter *iter, | ||
1653 | + const gchar *text, | ||
1654 | + gint len, | ||
1655 | + gboolean create_tags, | ||
1656 | + GError **error) | ||
1657 | +{ | ||
1658 | + GList *headers; | ||
1659 | + Header *header; | ||
1660 | + gboolean retval; | ||
1661 | + | ||
1662 | + headers = read_headers (text, len, error); | ||
1663 | + | ||
1664 | + if (!headers) | ||
1665 | + return FALSE; | ||
1666 | + | ||
1667 | + header = headers->data; | ||
1668 | + if (!header_is (header, "RICHTEXT")) | ||
1669 | + { | ||
1670 | + g_set_error (error, | ||
1671 | + G_MARKUP_ERROR, | ||
1672 | + G_MARKUP_ERROR_PARSE, | ||
1673 | + _("Serialized data is malformed. First section isn't RICHTEXT")); | ||
1674 | + | ||
1675 | + retval = FALSE; | ||
1676 | + goto out; | ||
1677 | + } | ||
1678 | + | ||
1679 | + retval = deserialize_text (buffer, iter, | ||
1680 | + header->start, header->length, | ||
1681 | + create_tags, error, headers->next); | ||
1682 | + | ||
1683 | + out: | ||
1684 | + g_list_foreach (headers, (GFunc)g_free, NULL); | ||
1685 | + g_list_free (headers); | ||
1686 | + | ||
1687 | + return retval; | ||
1688 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbufferserialize.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbufferserialize.h.diff deleted file mode 100644 index 653c227cbe..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextbufferserialize.h.diff +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktextbufferserialize.h 1970-01-01 02:00:00.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktextbufferserialize.h 2005-04-06 16:19:38.025757568 +0300 | ||
3 | @@ -0,0 +1,37 @@ | ||
4 | +/* gtktextbufferserialize.h | ||
5 | + * | ||
6 | + * Copyright (C) 2004 Nokia | ||
7 | + * | ||
8 | + * This library is free software; you can redistribute it and/or | ||
9 | + * modify it under the terms of the GNU Library General Public | ||
10 | + * License as published by the Free Software Foundation; either | ||
11 | + * version 2 of the License, or (at your option) any later version. | ||
12 | + * | ||
13 | + * This library is distributed in the hope that it will be useful, | ||
14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | + * Library General Public License for more details. | ||
17 | + * | ||
18 | + * You should have received a copy of the GNU Library General Public | ||
19 | + * License along with this library; if not, write to the | ||
20 | + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
21 | + * Boston, MA 02111-1307, USA. | ||
22 | + */ | ||
23 | +#ifndef GTK_TEXT_BUFFER_SERIALIZE_H | ||
24 | + | ||
25 | +#include <gtk/gtktextbuffer.h> | ||
26 | + | ||
27 | +gchar *gtk_text_buffer_serialize_rich_text (GtkTextBuffer *buffer, | ||
28 | + const GtkTextIter *start, | ||
29 | + const GtkTextIter *end, | ||
30 | + gint *len); | ||
31 | + | ||
32 | +gboolean gtk_text_buffer_deserialize_rich_text (GtkTextBuffer *buffer, | ||
33 | + GtkTextIter *iter, | ||
34 | + const gchar *text, | ||
35 | + gint len, | ||
36 | + gboolean create_tags, | ||
37 | + GError **error); | ||
38 | + | ||
39 | + | ||
40 | +#endif /* GTK_TEXT_BUFFER_SERIALIZE_H */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextview.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextview.c.diff deleted file mode 100644 index 7323574a64..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktextview.c.diff +++ /dev/null | |||
@@ -1,417 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktextview.c 2005-03-01 08:28:56.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktextview.c 2005-04-06 16:19:38.152738264 +0300 | ||
3 | @@ -99,6 +99,11 @@ | ||
4 | |||
5 | #define SPACE_FOR_CURSOR 1 | ||
6 | |||
7 | +typedef struct _GtkTextViewPrivate GtkTextViewPrivate; | ||
8 | + | ||
9 | +#define GTK_TEXT_VIEW_GET_PRIVATE(obj) ( G_TYPE_INSTANCE_GET_PRIVATE ((obj),\ | ||
10 | + GTK_TYPE_TEXT_VIEW, GtkTextViewPrivate) ) | ||
11 | + | ||
12 | struct _GtkTextPendingScroll | ||
13 | { | ||
14 | GtkTextMark *mark; | ||
15 | @@ -145,6 +150,8 @@ | ||
16 | PROP_BUFFER, | ||
17 | PROP_OVERWRITE, | ||
18 | PROP_ACCEPTS_TAB, | ||
19 | + PROP_AUTOCAP, | ||
20 | + PROP_INPUT_MODE, | ||
21 | LAST_PROP | ||
22 | }; | ||
23 | |||
24 | @@ -343,6 +350,13 @@ | ||
25 | |||
26 | static void gtk_text_view_update_im_spot_location (GtkTextView *text_view); | ||
27 | |||
28 | +static void gtk_text_view_set_autocap (GtkTextView *text_view, | ||
29 | + gboolean autocap); | ||
30 | +static gboolean gtk_text_view_get_autocap (GtkTextView *text_view); | ||
31 | +static void gtk_text_view_set_input_mode (GtkTextView *text_view, | ||
32 | + gint mode); | ||
33 | +static gint gtk_text_view_get_input_mode (GtkTextView *text_view); | ||
34 | + | ||
35 | /* Container methods */ | ||
36 | static void gtk_text_view_add (GtkContainer *container, | ||
37 | GtkWidget *child); | ||
38 | @@ -412,6 +426,10 @@ | ||
39 | static gint text_window_get_width (GtkTextWindow *win); | ||
40 | static gint text_window_get_height (GtkTextWindow *win); | ||
41 | |||
42 | +struct _GtkTextViewPrivate | ||
43 | +{ | ||
44 | + guint release_selection : 1; | ||
45 | +}; | ||
46 | |||
47 | static const GtkTargetEntry target_table[] = { | ||
48 | { "GTK_TEXT_BUFFER_CONTENTS", GTK_TARGET_SAME_APP, 0 }, | ||
49 | @@ -481,6 +499,7 @@ | ||
50 | |||
51 | parent_class = g_type_class_peek_parent (klass); | ||
52 | |||
53 | + g_type_class_add_private( klass, sizeof(GtkTextViewPrivate) ); | ||
54 | /* Default handlers and virtual methods | ||
55 | */ | ||
56 | gobject_class->set_property = gtk_text_view_set_property; | ||
57 | @@ -667,6 +686,24 @@ | ||
58 | TRUE, | ||
59 | G_PARAM_READWRITE)); | ||
60 | |||
61 | + g_object_class_install_property (gobject_class, | ||
62 | + PROP_AUTOCAP, | ||
63 | + g_param_spec_boolean ("autocap", | ||
64 | + P_("auto capitalization"), | ||
65 | + P_("Enable autocap support"), | ||
66 | + TRUE, | ||
67 | + G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
68 | + | ||
69 | + g_object_class_install_property (gobject_class, | ||
70 | + PROP_INPUT_MODE, | ||
71 | + g_param_spec_int ("input_mode", | ||
72 | + P_("input mode"), | ||
73 | + P_("Define widget's input mode"), | ||
74 | + 0, | ||
75 | + 9, /* keep me updated */ | ||
76 | + 0, | ||
77 | + G_PARAM_READABLE | G_PARAM_WRITABLE)); | ||
78 | + | ||
79 | /* | ||
80 | * Style properties | ||
81 | */ | ||
82 | @@ -676,6 +713,14 @@ | ||
83 | P_("Color with which to draw error-indication underlines"), | ||
84 | GDK_TYPE_COLOR, | ||
85 | G_PARAM_READABLE)); | ||
86 | + | ||
87 | + gtk_widget_class_install_style_property (widget_class, | ||
88 | + g_param_spec_boolean ("autocap", | ||
89 | + _("auto capitalization"), | ||
90 | + _("Enable autocap support"), | ||
91 | + TRUE, | ||
92 | + G_PARAM_READABLE)); | ||
93 | + | ||
94 | |||
95 | /* | ||
96 | * Signals | ||
97 | @@ -1040,8 +1085,9 @@ | ||
98 | gtk_text_view_init (GtkTextView *text_view) | ||
99 | { | ||
100 | GtkWidget *widget; | ||
101 | - | ||
102 | + GtkTextViewPrivate *priv = NULL; | ||
103 | widget = GTK_WIDGET (text_view); | ||
104 | + priv = GTK_TEXT_VIEW_GET_PRIVATE(text_view); | ||
105 | |||
106 | GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS); | ||
107 | |||
108 | @@ -1057,6 +1103,8 @@ | ||
109 | text_view->tabs = NULL; | ||
110 | text_view->editable = TRUE; | ||
111 | |||
112 | + priv->release_selection = TRUE; | ||
113 | + | ||
114 | gtk_drag_dest_set (widget, | ||
115 | 0, | ||
116 | target_table, G_N_ELEMENTS (target_table), | ||
117 | @@ -1070,6 +1118,10 @@ | ||
118 | * to it; so we create it here and destroy it in finalize (). | ||
119 | */ | ||
120 | text_view->im_context = gtk_im_multicontext_new (); | ||
121 | + /* Set default stuff. */ | ||
122 | + gtk_text_view_set_autocap (text_view, TRUE); | ||
123 | + gtk_text_view_set_input_mode (text_view, 0); /* alpha-numeric-special */ | ||
124 | + g_object_set (G_OBJECT (text_view->im_context), "use-show-hide", TRUE, NULL); | ||
125 | |||
126 | g_signal_connect (text_view->im_context, "commit", | ||
127 | G_CALLBACK (gtk_text_view_commit_handler), text_view); | ||
128 | @@ -2664,6 +2716,14 @@ | ||
129 | gtk_text_view_set_accepts_tab (text_view, g_value_get_boolean (value)); | ||
130 | break; | ||
131 | |||
132 | + case PROP_AUTOCAP: | ||
133 | + gtk_text_view_set_autocap (text_view, g_value_get_boolean (value)); | ||
134 | + break; | ||
135 | + | ||
136 | + case PROP_INPUT_MODE: | ||
137 | + gtk_text_view_set_input_mode (text_view, g_value_get_int (value)); | ||
138 | + break; | ||
139 | + | ||
140 | default: | ||
141 | g_assert_not_reached (); | ||
142 | break; | ||
143 | @@ -2738,6 +2798,14 @@ | ||
144 | g_value_set_boolean (value, text_view->accepts_tab); | ||
145 | break; | ||
146 | |||
147 | + case PROP_AUTOCAP: | ||
148 | + g_value_set_boolean (value, gtk_text_view_get_autocap (text_view)); | ||
149 | + break; | ||
150 | + | ||
151 | + case PROP_INPUT_MODE: | ||
152 | + g_value_set_int (value, gtk_text_view_get_input_mode (text_view)); | ||
153 | + break; | ||
154 | + | ||
155 | default: | ||
156 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
157 | break; | ||
158 | @@ -3916,7 +3984,7 @@ | ||
159 | GtkTextView *text_view = GTK_TEXT_VIEW (widget); | ||
160 | GtkTextMark *insert; | ||
161 | GtkTextIter iter; | ||
162 | - | ||
163 | + | ||
164 | if (text_view->layout == NULL || get_buffer (text_view) == NULL) | ||
165 | return FALSE; | ||
166 | |||
167 | @@ -4039,6 +4107,9 @@ | ||
168 | if (event->window != text_view->text_window->bin_window) | ||
169 | return FALSE; | ||
170 | |||
171 | + if (text_view->editable) | ||
172 | + gtk_im_context_show (text_view->im_context); | ||
173 | + | ||
174 | if (event->button == 1) | ||
175 | { | ||
176 | if (text_view->drag_start_x >= 0) | ||
177 | @@ -4083,7 +4154,15 @@ | ||
178 | static gint | ||
179 | gtk_text_view_focus_in_event (GtkWidget *widget, GdkEventFocus *event) | ||
180 | { | ||
181 | + /*gboolean have_selection; | ||
182 | + GtkTextIter sel_start, sel_end;*/ | ||
183 | + | ||
184 | GtkTextView *text_view = GTK_TEXT_VIEW (widget); | ||
185 | + | ||
186 | + /*have_selection = gtk_text_buffer_get_selection_bounds(text_view->buffer, &sel_start, &sel_end); | ||
187 | + | ||
188 | + if(!have_selection) | ||
189 | + gtk_text_view_move_cursor(text_view, GTK_MOVEMENT_BUFFER_ENDS, 1, FALSE);*//*FIXME some other way to place the cursor in the end*/ | ||
190 | |||
191 | gtk_widget_queue_draw (widget); | ||
192 | |||
193 | @@ -4100,8 +4179,10 @@ | ||
194 | G_CALLBACK (keymap_direction_changed), text_view); | ||
195 | gtk_text_view_check_keymap_direction (text_view); | ||
196 | |||
197 | + /* Keyboard hack */ | ||
198 | text_view->need_im_reset = TRUE; | ||
199 | gtk_im_context_focus_in (GTK_TEXT_VIEW (widget)->im_context); | ||
200 | + gtk_text_view_reset_im_context (text_view); | ||
201 | |||
202 | return FALSE; | ||
203 | } | ||
204 | @@ -4110,6 +4191,14 @@ | ||
205 | gtk_text_view_focus_out_event (GtkWidget *widget, GdkEventFocus *event) | ||
206 | { | ||
207 | GtkTextView *text_view = GTK_TEXT_VIEW (widget); | ||
208 | + GtkTextViewPrivate *priv = GTK_TEXT_VIEW_GET_PRIVATE(text_view); | ||
209 | + /*{ | ||
210 | + GtkTextIter start; | ||
211 | + GtkTextIter end; | ||
212 | + | ||
213 | + gtk_text_buffer_get_bounds(text_view->buffer, &start, &end); | ||
214 | + gtk_text_buffer_select_range(text_view->buffer, &start, &start); | ||
215 | + }*//*FIXME need a hack here to take away the focus*/ | ||
216 | |||
217 | gtk_widget_queue_draw (widget); | ||
218 | |||
219 | @@ -4125,8 +4214,11 @@ | ||
220 | keymap_direction_changed, | ||
221 | text_view); | ||
222 | |||
223 | - text_view->need_im_reset = TRUE; | ||
224 | - gtk_im_context_focus_out (GTK_TEXT_VIEW (widget)->im_context); | ||
225 | + /* This is commented out to disable unselect feature. | ||
226 | + When the decition of this has been made, we can either remove this patch | ||
227 | + or to leave it. | ||
228 | + if( priv->release_selection ) | ||
229 | + gtk_text_view_unselect( text_view );*/ | ||
230 | |||
231 | return FALSE; | ||
232 | } | ||
233 | @@ -5082,7 +5174,8 @@ | ||
234 | GtkTextIter end; | ||
235 | gboolean leave_one = FALSE; | ||
236 | |||
237 | - gtk_text_view_reset_im_context (text_view); | ||
238 | + /*gtk_text_view_reset_im_context (text_view);*/ /*backspace should not clear | ||
239 | + the word completion*/ | ||
240 | |||
241 | if (type == GTK_DELETE_CHARS) | ||
242 | { | ||
243 | @@ -5200,7 +5293,8 @@ | ||
244 | { | ||
245 | GtkTextIter insert; | ||
246 | |||
247 | - gtk_text_view_reset_im_context (text_view); | ||
248 | + /*gtk_text_view_reset_im_context (text_view);*/ /*backspace should not clear | ||
249 | + the word completion*/ | ||
250 | |||
251 | /* Backspace deletes the selection, if one exists */ | ||
252 | if (gtk_text_buffer_delete_selection (get_buffer (text_view), TRUE, | ||
253 | @@ -5928,11 +6022,11 @@ | ||
254 | static void | ||
255 | gtk_text_view_reset_im_context (GtkTextView *text_view) | ||
256 | { | ||
257 | - if (text_view->need_im_reset) | ||
258 | +/* if (text_view->need_im_reset) | ||
259 | { | ||
260 | - text_view->need_im_reset = FALSE; | ||
261 | + text_view->need_im_reset = FALSE;*/ | ||
262 | gtk_im_context_reset (text_view->im_context); | ||
263 | - } | ||
264 | +/* }*/ | ||
265 | } | ||
266 | |||
267 | /* | ||
268 | @@ -6665,18 +6759,23 @@ | ||
269 | { | ||
270 | GtkTextIter start; | ||
271 | GtkTextIter end; | ||
272 | - gint pos; | ||
273 | + gint pos, endpos; | ||
274 | gchar *text; | ||
275 | |||
276 | - gtk_text_buffer_get_iter_at_mark (text_view->buffer, &start, | ||
277 | + gtk_text_buffer_get_iter_at_line (text_view->buffer, &start, 0); | ||
278 | + gtk_text_buffer_get_iter_at_mark (text_view->buffer, &end, | ||
279 | gtk_text_buffer_get_insert (text_view->buffer)); | ||
280 | - end = start; | ||
281 | |||
282 | - pos = gtk_text_iter_get_line_index (&start); | ||
283 | - gtk_text_iter_set_line_offset (&start, 0); | ||
284 | + pos = gtk_text_iter_get_line_index (&end); | ||
285 | + | ||
286 | gtk_text_iter_forward_to_line_end (&end); | ||
287 | + endpos = gtk_text_iter_get_line_index (&end); | ||
288 | |||
289 | text = gtk_text_iter_get_slice (&start, &end); | ||
290 | + if (text) | ||
291 | + pos = strlen (text) - (endpos - pos); /* want bytes, not characters */ | ||
292 | + else | ||
293 | + pos = 0; | ||
294 | gtk_im_context_set_surrounding (context, text, -1, pos); | ||
295 | g_free (text); | ||
296 | |||
297 | @@ -6726,8 +6825,8 @@ | ||
298 | need_reset = TRUE; | ||
299 | } | ||
300 | |||
301 | - if (need_reset) | ||
302 | - gtk_text_view_reset_im_context (text_view); | ||
303 | + /*if (need_reset) | ||
304 | + gtk_text_view_reset_im_context (text_view);*//*FIXME need a hack here*/ | ||
305 | } | ||
306 | |||
307 | static void | ||
308 | @@ -6957,6 +7056,13 @@ | ||
309 | } | ||
310 | |||
311 | static void | ||
312 | +block_selection_change( GtkMenuShell *menushell, gpointer user_data ) | ||
313 | +{ | ||
314 | + GtkTextViewPrivate *priv = GTK_TEXT_VIEW_GET_PRIVATE(user_data); | ||
315 | + priv->release_selection = TRUE; | ||
316 | +} | ||
317 | + | ||
318 | +static void | ||
319 | unichar_chosen_func (const char *text, | ||
320 | gpointer data) | ||
321 | { | ||
322 | @@ -7064,7 +7170,12 @@ | ||
323 | signals[POPULATE_POPUP], | ||
324 | 0, | ||
325 | text_view->popup_menu); | ||
326 | - | ||
327 | + { | ||
328 | + GtkTextViewPrivate *priv = GTK_TEXT_VIEW_GET_PRIVATE(text_view); | ||
329 | + g_signal_connect( GTK_WIDGET(text_view->popup_menu), "selection-done", | ||
330 | + G_CALLBACK(block_selection_change), text_view ); | ||
331 | + priv->release_selection = FALSE; | ||
332 | + } | ||
333 | if (info->button) | ||
334 | gtk_menu_popup (GTK_MENU (text_view->popup_menu), NULL, NULL, | ||
335 | NULL, NULL, | ||
336 | @@ -8301,3 +8412,81 @@ | ||
337 | |||
338 | return gtk_text_layout_move_iter_visually (text_view->layout, iter, count); | ||
339 | } | ||
340 | + | ||
341 | +/* | ||
342 | + * gtk_text_view_set_autocap: | ||
343 | + * @entry: a #GtkTextView | ||
344 | + * @autocap: autocap | ||
345 | + * | ||
346 | + * Sets autocapitalization of the widget. | ||
347 | + */ | ||
348 | +static void | ||
349 | +gtk_text_view_set_autocap (GtkTextView *text_view, | ||
350 | + gboolean autocap) | ||
351 | +{ | ||
352 | + g_return_if_fail (GTK_IS_TEXT_VIEW (text_view)); | ||
353 | + | ||
354 | + if (gtk_text_view_get_autocap (text_view) != autocap) | ||
355 | + { | ||
356 | + g_object_set (G_OBJECT (text_view->im_context), "autocap", autocap, NULL); | ||
357 | + g_object_notify (G_OBJECT (text_view), "autocap"); | ||
358 | + } | ||
359 | +} | ||
360 | + | ||
361 | +/* | ||
362 | + * gtk_text_view_get_autocap: | ||
363 | + * @entry: a #GtkTextView | ||
364 | + * | ||
365 | + * Gets autocapitalization state of the widget. | ||
366 | + * | ||
367 | + * Return value: a state | ||
368 | + */ | ||
369 | +static gboolean | ||
370 | +gtk_text_view_get_autocap (GtkTextView *text_view) | ||
371 | +{ | ||
372 | + gboolean autocap; | ||
373 | + g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), FALSE); | ||
374 | + | ||
375 | + g_object_get (G_OBJECT (text_view->im_context), "autocap", &autocap, NULL); | ||
376 | + | ||
377 | + return autocap; | ||
378 | +} | ||
379 | + | ||
380 | +/* | ||
381 | + * gtk_text_view_set_input_mode: | ||
382 | + * @text_view: a #GtkTextView | ||
383 | + * @mode: input mode | ||
384 | + * | ||
385 | + * Sets autocapitalization of the widget. | ||
386 | + */ | ||
387 | +static void | ||
388 | +gtk_text_view_set_input_mode (GtkTextView *text_view, | ||
389 | + gint mode) | ||
390 | +{ | ||
391 | + g_return_if_fail (GTK_IS_TEXT_VIEW (text_view)); | ||
392 | + | ||
393 | + if (gtk_text_view_get_input_mode (text_view) != mode) | ||
394 | + { | ||
395 | + g_object_set (G_OBJECT (text_view->im_context), "input_mode", mode, NULL); | ||
396 | + g_object_notify (G_OBJECT (text_view), "input_mode"); | ||
397 | + } | ||
398 | +} | ||
399 | + | ||
400 | +/* | ||
401 | + * gtk_text_view_get_input_mode: | ||
402 | + * @text_view: a #GtkTextView | ||
403 | + * | ||
404 | + * Gets input mode of the widget. | ||
405 | + * | ||
406 | + * Return value: input mode | ||
407 | + */ | ||
408 | +static gint | ||
409 | +gtk_text_view_get_input_mode (GtkTextView *text_view) | ||
410 | +{ | ||
411 | + gint mode; | ||
412 | + g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), FALSE); | ||
413 | + | ||
414 | + g_object_get (G_OBJECT (text_view->im_context), "input_mode", &mode, NULL); | ||
415 | + | ||
416 | + return mode; | ||
417 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbar.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbar.c.diff deleted file mode 100644 index b99d346f4b..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbar.c.diff +++ /dev/null | |||
@@ -1,252 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktoolbar.c 2004-11-23 06:11:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktoolbar.c 2005-04-06 16:19:38.166736136 +0300 | ||
3 | @@ -67,7 +67,9 @@ | ||
4 | |||
5 | #define DEFAULT_ICON_SIZE GTK_ICON_SIZE_LARGE_TOOLBAR | ||
6 | #define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH | ||
7 | +#define DEFAULT_ANIMATION_STATE FALSE | ||
8 | |||
9 | +#define DEFAULT_MAX_CHILD_SPACING G_MAXINT | ||
10 | #define MAX_HOMOGENEOUS_N_CHARS 13 /* Items that are wider than this do not participate | ||
11 | * in the homogeneous game. In units of | ||
12 | * pango_font_get_estimated_char_width(). | ||
13 | @@ -140,10 +142,14 @@ | ||
14 | |||
15 | GTimer * timer; | ||
16 | |||
17 | + guint animation_connection; | ||
18 | + | ||
19 | guint show_arrow : 1; | ||
20 | guint need_sync : 1; | ||
21 | guint is_sliding : 1; | ||
22 | guint need_rebuild : 1; /* whether the overflow menu should be regenerated */ | ||
23 | + guint animation_set : 1; | ||
24 | + guint animation : 1; | ||
25 | }; | ||
26 | |||
27 | static void gtk_toolbar_init (GtkToolbar *toolbar); | ||
28 | @@ -225,9 +231,11 @@ | ||
29 | static void gtk_toolbar_reconfigured (GtkToolbar *toolbar); | ||
30 | static gboolean gtk_toolbar_check_new_api (GtkToolbar *toolbar); | ||
31 | static gboolean gtk_toolbar_check_old_api (GtkToolbar *toolbar); | ||
32 | +static void gtk_toolbar_update_animation_state (GtkToolbar *toolbar); | ||
33 | |||
34 | static GtkReliefStyle get_button_relief (GtkToolbar *toolbar); | ||
35 | static gint get_internal_padding (GtkToolbar *toolbar); | ||
36 | +static gint get_max_child_expand (GtkToolbar *toolbar); | ||
37 | static GtkShadowType get_shadow_type (GtkToolbar *toolbar); | ||
38 | static gint get_space_size (GtkToolbar *toolbar); | ||
39 | static GtkToolbarSpaceStyle get_space_style (GtkToolbar *toolbar); | ||
40 | @@ -563,6 +571,15 @@ | ||
41 | G_PARAM_READABLE)); | ||
42 | |||
43 | gtk_widget_class_install_style_property (widget_class, | ||
44 | + g_param_spec_int ("max_child_expand", | ||
45 | + P_("Maximum toolbar item spacing"), | ||
46 | + P_("Maximum space between the toolbar items."), | ||
47 | + 0, | ||
48 | + G_MAXINT, | ||
49 | + DEFAULT_MAX_CHILD_SPACING, | ||
50 | + G_PARAM_READABLE)); | ||
51 | + | ||
52 | + gtk_widget_class_install_style_property (widget_class, | ||
53 | g_param_spec_enum ("space_style", | ||
54 | P_("Space style"), | ||
55 | P_("Whether spacers are vertical lines or just blank"), | ||
56 | @@ -598,6 +615,12 @@ | ||
57 | GTK_TYPE_ICON_SIZE, | ||
58 | DEFAULT_ICON_SIZE, | ||
59 | G_PARAM_READWRITE)); | ||
60 | + | ||
61 | + gtk_settings_install_property (g_param_spec_boolean ("gtk-toolbar-animation", | ||
62 | + P_("Toolbar animation"), | ||
63 | + P_("Are we using toolbar animation"), | ||
64 | + DEFAULT_ANIMATION_STATE, | ||
65 | + G_PARAM_READWRITE)); | ||
66 | |||
67 | binding_set = gtk_binding_set_by_class (klass); | ||
68 | |||
69 | @@ -638,6 +661,7 @@ | ||
70 | toolbar->orientation = GTK_ORIENTATION_HORIZONTAL; | ||
71 | toolbar->style = DEFAULT_TOOLBAR_STYLE; | ||
72 | toolbar->icon_size = DEFAULT_ICON_SIZE; | ||
73 | + priv->animation = DEFAULT_ANIMATION_STATE; | ||
74 | toolbar->tooltips = gtk_tooltips_new (); | ||
75 | g_object_ref (toolbar->tooltips); | ||
76 | gtk_object_sink (GTK_OBJECT (toolbar->tooltips)); | ||
77 | @@ -960,7 +984,7 @@ | ||
78 | } | ||
79 | |||
80 | static gint | ||
81 | -position (gint from, gint to, gdouble elapsed) | ||
82 | +position (GtkToolbar *toolbar, gint from, gint to, gdouble elapsed) | ||
83 | { | ||
84 | gint n_pixels; | ||
85 | |||
86 | @@ -978,11 +1002,20 @@ | ||
87 | n_pixels = (SLIDE_SPEED / ACCEL_THRESHOLD) * elapsed * elapsed - | ||
88 | SLIDE_SPEED * elapsed + SLIDE_SPEED * ACCEL_THRESHOLD; | ||
89 | } | ||
90 | - | ||
91 | - if (to > from) | ||
92 | - return MIN (from + n_pixels, to); | ||
93 | - else | ||
94 | - return MAX (from - n_pixels, to); | ||
95 | + if (GTK_TOOLBAR_GET_PRIVATE (toolbar)->animation) { | ||
96 | + if (to > from) | ||
97 | + return MIN (from + n_pixels, to); | ||
98 | + else | ||
99 | + return MAX (from - n_pixels, to); | ||
100 | + } | ||
101 | + return to; | ||
102 | +} | ||
103 | + | ||
104 | +static GtkSettings * | ||
105 | +toolbar_get_settings (GtkToolbar *toolbar) | ||
106 | +{ | ||
107 | + GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); | ||
108 | + return priv->settings; | ||
109 | } | ||
110 | |||
111 | static void | ||
112 | @@ -994,12 +1027,12 @@ | ||
113 | GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); | ||
114 | gdouble elapsed = g_timer_elapsed (priv->timer, NULL); | ||
115 | |||
116 | - intermediate->x = position (start->x, goal->x, elapsed); | ||
117 | - intermediate->y = position (start->y, goal->y, elapsed); | ||
118 | + intermediate->x = position (toolbar, start->x, goal->x, elapsed); | ||
119 | + intermediate->y = position (toolbar, start->y, goal->y, elapsed); | ||
120 | intermediate->width = | ||
121 | - position (start->x + start->width, goal->x + goal->width, elapsed) - intermediate->x; | ||
122 | + position (toolbar, start->x + start->width, goal->x + goal->width, elapsed) - intermediate->x; | ||
123 | intermediate->height = | ||
124 | - position (start->y + start->height, goal->y + goal->height, elapsed) - intermediate->y; | ||
125 | + position (toolbar, start->y + start->height, goal->y + goal->height, elapsed) - intermediate->y; | ||
126 | } | ||
127 | |||
128 | static void | ||
129 | @@ -1047,6 +1080,32 @@ | ||
130 | } | ||
131 | } | ||
132 | |||
133 | +static void | ||
134 | +gtk_toolbar_update_animation_state (GtkToolbar *toolbar) | ||
135 | +{ | ||
136 | + gboolean animation_state; | ||
137 | + GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); | ||
138 | + | ||
139 | + g_return_if_fail (GTK_IS_TOOLBAR (toolbar)); | ||
140 | + | ||
141 | + if (priv->animation_set) | ||
142 | + { | ||
143 | + GtkSettings *settings = toolbar_get_settings (toolbar); | ||
144 | + | ||
145 | + if (settings) | ||
146 | + { | ||
147 | + g_object_get (settings, | ||
148 | + "gtk-toolbar-animation", &animation_state, | ||
149 | + NULL); | ||
150 | + } | ||
151 | + else | ||
152 | + animation_state = DEFAULT_ANIMATION_STATE; | ||
153 | + | ||
154 | + priv->animation = animation_state; | ||
155 | + priv->animation_set = FALSE; | ||
156 | + } | ||
157 | +} | ||
158 | + | ||
159 | static gboolean | ||
160 | slide_idle_handler (gpointer data) | ||
161 | { | ||
162 | @@ -1537,10 +1596,14 @@ | ||
163 | |||
164 | if (toolbar_content_get_expand (content) && new_states[i] == NORMAL) | ||
165 | { | ||
166 | + gint mexpand = get_max_child_expand(toolbar); | ||
167 | gint extra = size / n_expand_items; | ||
168 | if (size % n_expand_items != 0) | ||
169 | extra++; | ||
170 | - | ||
171 | + if (extra > mexpand) { | ||
172 | + extra = mexpand; | ||
173 | + } | ||
174 | + | ||
175 | allocations[i].width += extra; | ||
176 | size -= extra; | ||
177 | n_expand_items--; | ||
178 | @@ -1932,11 +1995,16 @@ | ||
179 | } | ||
180 | } | ||
181 | |||
182 | -static GtkSettings * | ||
183 | -toolbar_get_settings (GtkToolbar *toolbar) | ||
184 | +static void | ||
185 | +animation_change_notify (GtkToolbar *toolbar) | ||
186 | { | ||
187 | GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); | ||
188 | - return priv->settings; | ||
189 | + if (!priv->animation_set) | ||
190 | + { | ||
191 | + /* pretend it was set, then unset, thus reverting to new default */ | ||
192 | + priv->animation_set = TRUE; | ||
193 | + gtk_toolbar_update_animation_state (toolbar); | ||
194 | + } | ||
195 | } | ||
196 | |||
197 | static void | ||
198 | @@ -1960,6 +2028,7 @@ | ||
199 | { | ||
200 | g_signal_handler_disconnect (old_settings, toolbar->style_set_connection); | ||
201 | g_signal_handler_disconnect (old_settings, toolbar->icon_size_connection); | ||
202 | + g_signal_handler_disconnect (old_settings, priv->animation_connection); | ||
203 | |||
204 | g_object_unref (old_settings); | ||
205 | } | ||
206 | @@ -1976,6 +2045,11 @@ | ||
207 | "notify::gtk-toolbar-icon-size", | ||
208 | G_CALLBACK (icon_size_change_notify), | ||
209 | toolbar); | ||
210 | + priv->animation_connection = | ||
211 | + g_signal_connect_swapped (settings, | ||
212 | + "notify::gtk-toolbar-animation", | ||
213 | + G_CALLBACK (animation_change_notify), | ||
214 | + toolbar); | ||
215 | |||
216 | g_object_ref (settings); | ||
217 | priv->settings = settings; | ||
218 | @@ -1985,6 +2059,7 @@ | ||
219 | |||
220 | style_change_notify (toolbar); | ||
221 | icon_size_change_notify (toolbar); | ||
222 | + animation_change_notify (toolbar); | ||
223 | } | ||
224 | |||
225 | static int | ||
226 | @@ -2913,7 +2988,7 @@ | ||
227 | * gtk_toolbar_get_icon_size: | ||
228 | * @toolbar: a #GtkToolbar | ||
229 | * | ||
230 | - * Retrieves the icon size fo the toolbar. See gtk_toolbar_set_icon_size(). | ||
231 | + * Retrieves the icon size for the toolbar. See gtk_toolbar_set_icon_size(). | ||
232 | * | ||
233 | * Return value: the current icon size for the icons on the toolbar. | ||
234 | **/ | ||
235 | @@ -4642,6 +4717,17 @@ | ||
236 | return ipadding; | ||
237 | } | ||
238 | |||
239 | +static gint | ||
240 | +get_max_child_expand (GtkToolbar *toolbar) | ||
241 | +{ | ||
242 | + gint mexpand = DEFAULT_MAX_CHILD_SPACING; | ||
243 | + | ||
244 | + gtk_widget_style_get (GTK_WIDGET (toolbar), | ||
245 | + "max_child_expand", &mexpand, | ||
246 | + NULL); | ||
247 | + return mexpand; | ||
248 | +} | ||
249 | + | ||
250 | static GtkShadowType | ||
251 | get_shadow_type (GtkToolbar *toolbar) | ||
252 | { | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbutton.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbutton.c.diff deleted file mode 100644 index 15e15fe796..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbutton.c.diff +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktoolbutton.c 2004-11-20 01:18:38.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktoolbutton.c 2005-04-06 16:19:38.167735984 +0300 | ||
3 | @@ -41,6 +41,7 @@ | ||
4 | |||
5 | enum { | ||
6 | CLICKED, | ||
7 | + INSENSITIVE_PRESS, | ||
8 | LAST_SIGNAL | ||
9 | }; | ||
10 | |||
11 | @@ -74,7 +75,10 @@ | ||
12 | GtkToolButton *button); | ||
13 | |||
14 | static void gtk_tool_button_construct_contents (GtkToolItem *tool_item); | ||
15 | - | ||
16 | + | ||
17 | + static void insensitive_press (GtkWidget *widget, | ||
18 | + GtkToolButton *button); | ||
19 | + | ||
20 | static GObjectClass *parent_class = NULL; | ||
21 | static guint toolbutton_signals[LAST_SIGNAL] = { 0 }; | ||
22 | |||
23 | @@ -226,7 +230,7 @@ | ||
24 | NULL, NULL, | ||
25 | g_cclosure_marshal_VOID__VOID, | ||
26 | G_TYPE_NONE, 0); | ||
27 | - | ||
28 | + | ||
29 | g_type_class_add_private (object_class, sizeof (GtkToolButtonPrivate)); | ||
30 | } | ||
31 | |||
32 | @@ -246,6 +250,10 @@ | ||
33 | g_signal_connect_object (button->priv->button, "clicked", | ||
34 | G_CALLBACK (button_clicked), button, 0); | ||
35 | |||
36 | + /* Hildon: connect "insensitive_press" signal for private button */ | ||
37 | + g_signal_connect_object (button->priv->button, "insensitive_press", | ||
38 | + G_CALLBACK (insensitive_press), button, 0); | ||
39 | + | ||
40 | gtk_container_add (GTK_CONTAINER (button), button->priv->button); | ||
41 | gtk_widget_show (button->priv->button); | ||
42 | } | ||
43 | @@ -519,7 +527,7 @@ | ||
44 | |||
45 | src_pixbuf = gtk_image_get_pixbuf (image); | ||
46 | dest_pixbuf = gdk_pixbuf_scale_simple (src_pixbuf, width, height, | ||
47 | - GDK_INTERP_BILINEAR); | ||
48 | + GDK_INTERP_NEAREST); | ||
49 | |||
50 | return gtk_image_new_from_pixbuf (dest_pixbuf); | ||
51 | } | ||
52 | @@ -594,6 +602,13 @@ | ||
53 | } | ||
54 | |||
55 | static void | ||
56 | +insensitive_press (GtkWidget *widget, | ||
57 | + GtkToolButton *button) | ||
58 | +{ | ||
59 | + g_signal_emit_by_name (button, "insensitive_press"); | ||
60 | +} | ||
61 | + | ||
62 | +static void | ||
63 | gtk_tool_button_toolbar_reconfigured (GtkToolItem *tool_item) | ||
64 | { | ||
65 | gtk_tool_button_construct_contents (tool_item); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbutton.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbutton.h.diff deleted file mode 100644 index f11a73b63d..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktoolbutton.h.diff +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktoolbutton.h 2004-11-23 22:02:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktoolbutton.h 2005-04-06 16:19:38.168735832 +0300 | ||
3 | @@ -54,6 +54,7 @@ | ||
4 | |||
5 | /* signal */ | ||
6 | void (* clicked) (GtkToolButton *tool_item); | ||
7 | + void (* insensitive_press) (GtkToolButton *tool_item); | ||
8 | |||
9 | /* Padding for future expansion */ | ||
10 | void (* _gtk_reserved1) (void); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreemodelfilter.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreemodelfilter.c.diff deleted file mode 100644 index af2d495a86..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreemodelfilter.c.diff +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktreemodelfilter.c 2005-02-24 16:43:53.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktreemodelfilter.c 2005-04-06 16:19:38.177734464 +0300 | ||
3 | @@ -1210,14 +1210,22 @@ | ||
4 | if (gtk_tree_path_get_depth (filter->priv->virtual_root) >= | ||
5 | gtk_tree_path_get_depth (c_path)) | ||
6 | { | ||
7 | - gint level; | ||
8 | + gint level, i; | ||
9 | gint *v_indices, *c_indices; | ||
10 | + gboolean common_prefix = TRUE; | ||
11 | |||
12 | level = gtk_tree_path_get_depth (c_path) - 1; | ||
13 | v_indices = gtk_tree_path_get_indices (filter->priv->virtual_root); | ||
14 | c_indices = gtk_tree_path_get_indices (c_path); | ||
15 | |||
16 | - if (v_indices[level] >= c_indices[level]) | ||
17 | + for (i = 0; i < level; i++) | ||
18 | + if (v_indices[i] != c_indices[i]) | ||
19 | + { | ||
20 | + common_prefix = FALSE; | ||
21 | + break; | ||
22 | + } | ||
23 | + | ||
24 | + if (common_prefix && v_indices[level] >= c_indices[level]) | ||
25 | (v_indices[level])++; | ||
26 | } | ||
27 | } | ||
28 | @@ -1455,14 +1463,22 @@ | ||
29 | if (gtk_tree_path_get_depth (filter->priv->virtual_root) >= | ||
30 | gtk_tree_path_get_depth (c_path)) | ||
31 | { | ||
32 | - gint level; | ||
33 | + gint level, i; | ||
34 | gint *v_indices, *c_indices; | ||
35 | + gboolean common_prefix = TRUE; | ||
36 | |||
37 | level = gtk_tree_path_get_depth (c_path) - 1; | ||
38 | v_indices = gtk_tree_path_get_indices (filter->priv->virtual_root); | ||
39 | c_indices = gtk_tree_path_get_indices (c_path); | ||
40 | |||
41 | - if (v_indices[level] > c_indices[level]) | ||
42 | + for (i = 0; i < level; i++) | ||
43 | + if (v_indices[i] != c_indices[i]) | ||
44 | + { | ||
45 | + common_prefix = FALSE; | ||
46 | + break; | ||
47 | + } | ||
48 | + | ||
49 | + if (common_prefix && v_indices[level] > c_indices[level]) | ||
50 | (v_indices[level])--; | ||
51 | } | ||
52 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreemodelsort.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreemodelsort.c.diff deleted file mode 100644 index 94139d162a..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreemodelsort.c.diff +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktreemodelsort.c 2004-11-30 23:45:26.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktreemodelsort.c 2005-04-06 16:19:38.178734312 +0300 | ||
3 | @@ -703,6 +703,18 @@ | ||
4 | tmppath = gtk_tree_model_get_path (GTK_TREE_MODEL (data), &tmpiter); | ||
5 | if (tmppath) | ||
6 | { | ||
7 | + GtkTreePath *path; | ||
8 | + GtkTreeIter iter; | ||
9 | + gboolean result; | ||
10 | + | ||
11 | + path = gtk_tree_path_copy (tmppath); | ||
12 | + gtk_tree_path_down (path); | ||
13 | + | ||
14 | + result = gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path); | ||
15 | + g_assert (result); | ||
16 | + gtk_tree_model_row_inserted (GTK_TREE_MODEL (data), path, &iter); | ||
17 | + gtk_tree_path_free (path); | ||
18 | + | ||
19 | gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (data), | ||
20 | tmppath, | ||
21 | &tmpiter); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeprivate.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeprivate.h.diff deleted file mode 100644 index 384c63bc7d..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeprivate.h.diff +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktreeprivate.h 2004-08-02 22:11:32.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtktreeprivate.h 2005-04-06 16:19:38.185733248 +0300 | ||
3 | @@ -232,6 +232,37 @@ | ||
4 | GtkTreeViewRowSeparatorFunc row_separator_func; | ||
5 | gpointer row_separator_data; | ||
6 | GtkDestroyNotify row_separator_destroy; | ||
7 | + | ||
8 | + /* Hildon additions */ | ||
9 | + guint new_state : 1; /* helper flag for pen drag in checkbox mode */ | ||
10 | + guint checkbox_mode : 1; /* is checkbox mode on right now? */ | ||
11 | + guint allow_checkbox_mode : 1; /* is checkbox mode ever allowed to be on? */ | ||
12 | + guint pen_down : 1; | ||
13 | + guint pen_drag_active : 1; | ||
14 | + guint pen_drag_motion_counter; | ||
15 | + guint pen_drag_reverse : 1; | ||
16 | + gboolean pen_scroll_timer; | ||
17 | + gdouble old_y; | ||
18 | + gboolean pen_focus; | ||
19 | + gboolean dotted_lines; | ||
20 | + gboolean force_list_kludge; | ||
21 | + | ||
22 | + /* the "pen down" row of the current pen drag */ | ||
23 | + GtkTreeRowReference *first_drag_row; | ||
24 | + | ||
25 | + /* most recently toggled row during pen drag */ | ||
26 | + GtkTreeRowReference *last_drag_row; | ||
27 | + | ||
28 | + /* for postponing tree node expand/collapse at | ||
29 | + button_press event until button_release event */ | ||
30 | + GtkTreeRowReference *queued_expand_row; | ||
31 | + | ||
32 | + /* for postponing selection clearing at button_press event | ||
33 | + until button_release event in painted multiple selection mode */ | ||
34 | + GtkTreeRowReference *queued_select_row; | ||
35 | + | ||
36 | + /* Hildon treeview can_focus hack */ | ||
37 | + guint check_if_can_focus_idle_id; | ||
38 | }; | ||
39 | |||
40 | #ifdef __GNUC__ | ||
41 | @@ -357,6 +388,7 @@ | ||
42 | GtkTreeViewColumn *column); | ||
43 | |||
44 | gboolean _gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column); | ||
45 | +gboolean _gtk_tree_view_column_has_activatable_cell (GtkTreeViewColumn *column); | ||
46 | GtkCellRenderer *_gtk_tree_view_column_get_edited_cell (GtkTreeViewColumn *column); | ||
47 | gint _gtk_tree_view_column_count_special_cells (GtkTreeViewColumn *column); | ||
48 | GtkCellRenderer *_gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column, | ||
49 | @@ -366,6 +398,9 @@ | ||
50 | GtkTreeSelection* _gtk_tree_selection_new_with_tree_view (GtkTreeView *tree_view); | ||
51 | void _gtk_tree_selection_set_tree_view (GtkTreeSelection *selection, | ||
52 | GtkTreeView *tree_view); | ||
53 | +gboolean _gtk_tree_selection_is_row_selectable (GtkTreeSelection *selection, | ||
54 | + GtkRBNode *node, | ||
55 | + GtkTreePath *path); | ||
56 | |||
57 | void _gtk_tree_view_column_cell_render (GtkTreeViewColumn *tree_column, | ||
58 | GdkWindow *window, | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeselection.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeselection.c.diff deleted file mode 100644 index 5361f9b5d1..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeselection.c.diff +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktreeselection.c 2004-11-20 01:18:38.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktreeselection.c 2005-04-06 16:19:38.186733096 +0300 | ||
3 | @@ -190,11 +190,28 @@ | ||
4 | GtkSelectionMode type) | ||
5 | { | ||
6 | GtkTreeSelectionFunc tmp_func; | ||
7 | + | ||
8 | g_return_if_fail (GTK_IS_TREE_SELECTION (selection)); | ||
9 | |||
10 | if (selection->type == type) | ||
11 | return; | ||
12 | |||
13 | + /* Hildon addition */ | ||
14 | + if ((type == GTK_SELECTION_SINGLE) && | ||
15 | + (selection->type == GTK_SELECTION_MULTIPLE || | ||
16 | + selection->type == GTK_SELECTION_BROWSE)) | ||
17 | + { | ||
18 | + GtkTreePath *cursor_path; | ||
19 | + | ||
20 | + /* to successfully switch from multiple selection mode to single | ||
21 | + selection, we must ensure that anchor exists and is selected | ||
22 | + since otherwise gtk_tree_selection_select_path won't work anymore */ | ||
23 | + if (gtk_tree_row_reference_valid (selection->tree_view->priv->cursor)) | ||
24 | + { | ||
25 | + cursor_path = gtk_tree_row_reference_get_path (selection->tree_view->priv->cursor); gtk_tree_selection_select_path (selection, cursor_path); | ||
26 | + gtk_tree_path_free (cursor_path); | ||
27 | + } | ||
28 | + } | ||
29 | |||
30 | if (type == GTK_SELECTION_NONE) | ||
31 | { | ||
32 | @@ -251,6 +268,20 @@ | ||
33 | } | ||
34 | |||
35 | selection->type = type; | ||
36 | + | ||
37 | + /* Hildon addition */ | ||
38 | + if (type == GTK_SELECTION_SINGLE) | ||
39 | + { | ||
40 | + GtkTreePath *path; | ||
41 | + GtkTreeIter iter; | ||
42 | + | ||
43 | + /* reset cursor to the selected row */ | ||
44 | + gtk_tree_selection_get_selected (selection, NULL, &iter); | ||
45 | + path = gtk_tree_model_get_path (selection->tree_view->priv->model, | ||
46 | + &iter); | ||
47 | + gtk_tree_view_set_cursor (selection->tree_view, path, NULL, FALSE); | ||
48 | + gtk_tree_path_free (path); | ||
49 | + } | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | @@ -1319,10 +1350,10 @@ | ||
54 | return sensitive; | ||
55 | } | ||
56 | |||
57 | -static gboolean | ||
58 | -row_is_selectable (GtkTreeSelection *selection, | ||
59 | - GtkRBNode *node, | ||
60 | - GtkTreePath *path) | ||
61 | +gboolean | ||
62 | +_gtk_tree_selection_is_row_selectable (GtkTreeSelection *selection, | ||
63 | + GtkRBNode *node, | ||
64 | + GtkTreePath *path) | ||
65 | { | ||
66 | GList *list; | ||
67 | GtkTreeIter iter; | ||
68 | @@ -1411,7 +1442,7 @@ | ||
69 | { | ||
70 | /* We only want to select the new node if we can unselect the old one, | ||
71 | * and we can select the new one. */ | ||
72 | - dirty = row_is_selectable (selection, node, path); | ||
73 | + dirty = _gtk_tree_selection_is_row_selectable (selection, node, path); | ||
74 | |||
75 | /* if dirty is FALSE, we weren't able to select the new one, otherwise, we try to | ||
76 | * unselect the new one | ||
77 | @@ -1528,8 +1559,13 @@ | ||
78 | if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) != select) | ||
79 | { | ||
80 | path = _gtk_tree_view_find_path (selection->tree_view, tree, node); | ||
81 | - selected = row_is_selectable (selection, node, path); | ||
82 | + selected = _gtk_tree_selection_is_row_selectable (selection, node, path); | ||
83 | gtk_tree_path_free (path); | ||
84 | + | ||
85 | + /* if row is unselectable, allow unselection only */ | ||
86 | + if (!selected && !select && | ||
87 | + GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED)) | ||
88 | + selected = TRUE; | ||
89 | } | ||
90 | |||
91 | if (selected == TRUE) | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeview.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeview.c.diff deleted file mode 100644 index 87ccffa868..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeview.c.diff +++ /dev/null | |||
@@ -1,2253 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktreeview.c 2005-02-24 00:38:20.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktreeview.c 2005-04-06 16:19:38.274719720 +0300 | ||
3 | @@ -42,6 +42,7 @@ | ||
4 | #include "gtkentry.h" | ||
5 | #include "gtkframe.h" | ||
6 | #include "gtktreemodelsort.h" | ||
7 | +#include "gtkscrolledwindow.h" | ||
8 | |||
9 | #define GTK_TREE_VIEW_PRIORITY_VALIDATE (GDK_PRIORITY_REDRAW + 5) | ||
10 | #define GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC (GTK_TREE_VIEW_PRIORITY_VALIDATE + 2) | ||
11 | @@ -114,6 +115,7 @@ | ||
12 | EXPAND_COLLAPSE_CURSOR_ROW, | ||
13 | SELECT_CURSOR_PARENT, | ||
14 | START_INTERACTIVE_SEARCH, | ||
15 | + ROW_INSENSITIVE, | ||
16 | LAST_SIGNAL | ||
17 | }; | ||
18 | |||
19 | @@ -132,7 +134,10 @@ | ||
20 | PROP_SEARCH_COLUMN, | ||
21 | PROP_FIXED_HEIGHT_MODE, | ||
22 | PROP_HOVER_SELECTION, | ||
23 | - PROP_HOVER_EXPAND | ||
24 | + PROP_HOVER_EXPAND, | ||
25 | + PROP_DOTTED_LINES, | ||
26 | + PROP_FORCE_LIST_KLUDGE, | ||
27 | + PROP_ALLOW_CHECKBOX_MODE | ||
28 | }; | ||
29 | |||
30 | static void gtk_tree_view_class_init (GtkTreeViewClass *klass); | ||
31 | @@ -338,8 +343,6 @@ | ||
32 | static void gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view, | ||
33 | GtkRBTree *tree, | ||
34 | GtkRBNode *node); | ||
35 | -static void gtk_tree_view_clamp_column_visible (GtkTreeView *tree_view, | ||
36 | - GtkTreeViewColumn *column); | ||
37 | static gboolean gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view, | ||
38 | GdkEventMotion *event); | ||
39 | static void gtk_tree_view_focus_to_cursor (GtkTreeView *tree_view); | ||
40 | @@ -372,6 +375,18 @@ | ||
41 | gpointer data); | ||
42 | static gboolean expand_collapse_timeout (gpointer data); | ||
43 | static gboolean do_expand_collapse (GtkTreeView *tree_view); | ||
44 | +static void update_checkbox_mode (GObject *object, | ||
45 | + GParamSpec *pspec, | ||
46 | + gpointer data); | ||
47 | +static void set_dotted_lines (GtkTreeView *tree_view, | ||
48 | + gboolean enable); | ||
49 | +static void selection_changed (GtkTreeSelection *selection, | ||
50 | + gpointer data); | ||
51 | +static void check_if_can_focus (GtkTreeView *tree_view); | ||
52 | +static gint scroll_row_timeout (gpointer data); | ||
53 | + | ||
54 | +static void add_scroll_timeout (GtkTreeView *tree_view); | ||
55 | +static void remove_scroll_timeout (GtkTreeView *tree_view); | ||
56 | |||
57 | /* interactive search */ | ||
58 | static void gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view); | ||
59 | @@ -694,8 +709,54 @@ | ||
60 | FALSE, | ||
61 | G_PARAM_READWRITE)); | ||
62 | |||
63 | + /** | ||
64 | + * GtkTreeView:dotted-lines: | ||
65 | + * | ||
66 | + * Enables or disables the dotted lines for hierarchical trees. | ||
67 | + * Hildon patch. | ||
68 | + */ | ||
69 | + g_object_class_install_property (o_class, | ||
70 | + PROP_DOTTED_LINES, | ||
71 | + g_param_spec_boolean ("dotted_lines", | ||
72 | + P_("Dotted Lines"), | ||
73 | + P_("Whether to show or hide dotted lines for hierarchical trees"), | ||
74 | + FALSE, | ||
75 | + G_PARAM_READWRITE)); | ||
76 | + | ||
77 | + /** | ||
78 | + * GtkTreeView:force-list-kludge: | ||
79 | + * | ||
80 | + * Hildon kludge for fixing file tree behaviour until a cleaner | ||
81 | + * implementation is scheduled: if this property is set, then rows | ||
82 | + * can be activated by tapping even if the underlying tree model is | ||
83 | + * not technically a list. | ||
84 | + */ | ||
85 | + g_object_class_install_property (o_class, | ||
86 | + PROP_FORCE_LIST_KLUDGE, | ||
87 | + g_param_spec_boolean ("force_list_kludge", | ||
88 | + P_("Force List Behaviour"), | ||
89 | + P_("Whether to activate tapped focused items even if model was not a list"), | ||
90 | + FALSE, | ||
91 | + G_PARAM_READWRITE)); | ||
92 | + | ||
93 | + /** | ||
94 | + * GtkTreeView:enable-checkbox-mode: | ||
95 | + * | ||
96 | + * Another Hildon kludge for allowing the existence of GtkTreeViews | ||
97 | + * that have activatable columns but that still is not a Text Listbox | ||
98 | + * in multiple selection with checkboxes mode. | ||
99 | + */ | ||
100 | + g_object_class_install_property (o_class, | ||
101 | + PROP_ALLOW_CHECKBOX_MODE, | ||
102 | + g_param_spec_boolean ("allow_checkbox_mode", | ||
103 | + P_("Enable Checkbox Mode"), | ||
104 | + P_("Whether to behave like a Listbox in a multiple selection with checkboxes mode, if checkboxes exist"), | ||
105 | + TRUE, | ||
106 | + G_PARAM_READWRITE)); | ||
107 | + | ||
108 | /* Style properties */ | ||
109 | #define _TREE_VIEW_EXPANDER_SIZE 12 | ||
110 | +#define _TREE_VIEW_EXPANDER_INDENT 10 | ||
111 | #define _TREE_VIEW_VERTICAL_SEPARATOR 2 | ||
112 | #define _TREE_VIEW_HORIZONTAL_SEPARATOR 2 | ||
113 | |||
114 | @@ -709,6 +770,15 @@ | ||
115 | G_PARAM_READABLE)); | ||
116 | |||
117 | gtk_widget_class_install_style_property (widget_class, | ||
118 | + g_param_spec_int ("expander_indent", | ||
119 | + P_("Expander intent"), | ||
120 | + P_("Defines the expanders indent"), | ||
121 | + 0, | ||
122 | + G_MAXINT, | ||
123 | + _TREE_VIEW_EXPANDER_INDENT, | ||
124 | + G_PARAM_READABLE)); | ||
125 | + | ||
126 | + gtk_widget_class_install_style_property (widget_class, | ||
127 | g_param_spec_int ("vertical_separator", | ||
128 | P_("Vertical Separator Width"), | ||
129 | P_("Vertical space between cells. Must be an even number"), | ||
130 | @@ -754,6 +824,13 @@ | ||
131 | GDK_TYPE_COLOR, | ||
132 | G_PARAM_READABLE)); | ||
133 | |||
134 | + gtk_widget_class_install_style_property (widget_class, | ||
135 | + g_param_spec_boolean ("passive_focus", | ||
136 | + P_("Enables passive focus"), | ||
137 | + P_("Used for tree view passive focus"), | ||
138 | + TRUE, | ||
139 | + G_PARAM_READABLE)); | ||
140 | + | ||
141 | /* Signals */ | ||
142 | widget_class->set_scroll_adjustments_signal = | ||
143 | g_signal_new ("set_scroll_adjustments", | ||
144 | @@ -917,6 +994,16 @@ | ||
145 | _gtk_marshal_BOOLEAN__NONE, | ||
146 | G_TYPE_BOOLEAN, 0); | ||
147 | |||
148 | + tree_view_signals[ROW_INSENSITIVE] = | ||
149 | + g_signal_new ("row_insensitive", | ||
150 | + G_TYPE_FROM_CLASS (o_class), | ||
151 | + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, | ||
152 | + G_STRUCT_OFFSET (GtkTreeViewClass, row_insensitive), | ||
153 | + NULL, NULL, | ||
154 | + _gtk_marshal_VOID__OBJECT, | ||
155 | + G_TYPE_NONE, 1, | ||
156 | + GTK_TYPE_TREE_PATH); | ||
157 | + | ||
158 | /* Key bindings */ | ||
159 | gtk_tree_view_add_move_binding (binding_set, GDK_Up, 0, | ||
160 | GTK_MOVEMENT_DISPLAY_LINES, -1); | ||
161 | @@ -1004,12 +1091,13 @@ | ||
162 | |||
163 | gtk_binding_entry_add_signal (binding_set, GDK_space, 0, "select_cursor_row", 1, | ||
164 | G_TYPE_BOOLEAN, TRUE); | ||
165 | + /* Hildon change: Enter shouldn't select | ||
166 | gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, "select_cursor_row", 1, | ||
167 | G_TYPE_BOOLEAN, TRUE); | ||
168 | gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, "select_cursor_row", 1, | ||
169 | G_TYPE_BOOLEAN, TRUE); | ||
170 | gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, "select_cursor_row", 1, | ||
171 | - G_TYPE_BOOLEAN, TRUE); | ||
172 | + G_TYPE_BOOLEAN, TRUE);*/ | ||
173 | |||
174 | /* expand and collapse rows */ | ||
175 | gtk_binding_entry_add_signal (binding_set, GDK_plus, 0, "expand_collapse_cursor_row", 3, | ||
176 | @@ -1123,19 +1211,31 @@ | ||
177 | gtk_binding_entry_add_signal (binding_set, GDK_f, GDK_CONTROL_MASK, "start_interactive_search", 0); | ||
178 | |||
179 | gtk_binding_entry_add_signal (binding_set, GDK_F, GDK_CONTROL_MASK, "start_interactive_search", 0); | ||
180 | + | ||
181 | + /* Hildon addition: Add key bindings to Right and Left arrows */ | ||
182 | + gtk_binding_entry_add_signal (binding_set, GDK_Right, 0, "expand_collapse_cursor_row", 3, | ||
183 | + G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, FALSE); | ||
184 | + gtk_binding_entry_add_signal (binding_set, GDK_plus, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, | ||
185 | + G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE, G_TYPE_BOOLEAN, TRUE); | ||
186 | + gtk_binding_entry_add_signal (binding_set, GDK_Left, 0, "expand_collapse_cursor_row", 3, | ||
187 | + G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE); | ||
188 | + gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_SHIFT_MASK, "expand_collapse_cursor_row", 3, | ||
189 | + G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, FALSE, G_TYPE_BOOLEAN, TRUE); | ||
190 | } | ||
191 | |||
192 | static void | ||
193 | gtk_tree_view_init (GtkTreeView *tree_view) | ||
194 | { | ||
195 | tree_view->priv = g_new0 (GtkTreeViewPrivate, 1); | ||
196 | - GTK_WIDGET_SET_FLAGS (tree_view, GTK_CAN_FOCUS); | ||
197 | + | ||
198 | + /* Hildon: focus cannot be gained until at least one row is added */ | ||
199 | + GTK_WIDGET_UNSET_FLAGS (tree_view, GTK_CAN_FOCUS); | ||
200 | |||
201 | gtk_widget_set_redraw_on_allocate (GTK_WIDGET (tree_view), FALSE); | ||
202 | |||
203 | + /* Hildon: Headers invisible by default */ | ||
204 | tree_view->priv->flags = GTK_TREE_VIEW_SHOW_EXPANDERS | ||
205 | - | GTK_TREE_VIEW_DRAW_KEYFOCUS | ||
206 | - | GTK_TREE_VIEW_HEADERS_VISIBLE; | ||
207 | + | GTK_TREE_VIEW_DRAW_KEYFOCUS; | ||
208 | |||
209 | /* We need some padding */ | ||
210 | tree_view->priv->dy = 0; | ||
211 | @@ -1165,6 +1265,26 @@ | ||
212 | |||
213 | tree_view->priv->hover_selection = FALSE; | ||
214 | tree_view->priv->hover_expand = FALSE; | ||
215 | + | ||
216 | + tree_view->priv->ctrl_pressed = FALSE; | ||
217 | + tree_view->priv->shift_pressed = FALSE; | ||
218 | + | ||
219 | + tree_view->priv->checkbox_mode = FALSE; | ||
220 | + tree_view->priv->allow_checkbox_mode = TRUE; | ||
221 | + tree_view->priv->pen_down = FALSE; | ||
222 | + tree_view->priv->pen_drag_active = FALSE; | ||
223 | + tree_view->priv->pen_drag_reverse = FALSE; | ||
224 | + tree_view->priv->first_drag_row = NULL; | ||
225 | + tree_view->priv->last_drag_row = NULL; | ||
226 | + tree_view->priv->queued_expand_row = NULL; | ||
227 | + tree_view->priv->queued_select_row = NULL; | ||
228 | + tree_view->priv->pen_focus = TRUE; | ||
229 | + | ||
230 | + /* Hildon: cursor should follow when selection changes */ | ||
231 | + g_signal_connect (tree_view->priv->selection, "changed", | ||
232 | + G_CALLBACK (selection_changed), tree_view); | ||
233 | + | ||
234 | + gtk_widget_set_name (GTK_WIDGET (tree_view), "treeview"); | ||
235 | } | ||
236 | |||
237 | |||
238 | @@ -1223,6 +1343,27 @@ | ||
239 | case PROP_HOVER_EXPAND: | ||
240 | tree_view->priv->hover_expand = g_value_get_boolean (value); | ||
241 | break; | ||
242 | + case PROP_DOTTED_LINES: | ||
243 | + set_dotted_lines (tree_view, g_value_get_boolean (value)); | ||
244 | + break; | ||
245 | + case PROP_FORCE_LIST_KLUDGE: | ||
246 | + tree_view->priv->force_list_kludge = g_value_get_boolean (value); | ||
247 | + break; | ||
248 | + case PROP_ALLOW_CHECKBOX_MODE: | ||
249 | + if ((tree_view->priv->allow_checkbox_mode = g_value_get_boolean (value))) | ||
250 | + { | ||
251 | + gtk_widget_set_name (GTK_WIDGET(tree_view), "treeview"); | ||
252 | + update_checkbox_mode (NULL, NULL, tree_view); | ||
253 | + } | ||
254 | + else | ||
255 | + { | ||
256 | + /* ugly hack - to ensure that checkboxes are independent of the | ||
257 | + selection if !allow_checkbox_mode, we must be able to use | ||
258 | + different theming in that case */ | ||
259 | + gtk_widget_set_name (GTK_WIDGET(tree_view), "no_checkbox_mode"); | ||
260 | + tree_view->priv->checkbox_mode = FALSE; | ||
261 | + } | ||
262 | + break; | ||
263 | default: | ||
264 | break; | ||
265 | } | ||
266 | @@ -1276,6 +1417,15 @@ | ||
267 | case PROP_HOVER_EXPAND: | ||
268 | g_value_set_boolean (value, tree_view->priv->hover_expand); | ||
269 | break; | ||
270 | + case PROP_DOTTED_LINES: | ||
271 | + g_value_set_boolean (value, tree_view->priv->dotted_lines); | ||
272 | + break; | ||
273 | + case PROP_FORCE_LIST_KLUDGE: | ||
274 | + g_value_set_boolean (value, tree_view->priv->force_list_kludge); | ||
275 | + break; | ||
276 | + case PROP_ALLOW_CHECKBOX_MODE: | ||
277 | + g_value_set_boolean (value, tree_view->priv->allow_checkbox_mode); | ||
278 | + break; | ||
279 | default: | ||
280 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
281 | break; | ||
282 | @@ -1376,6 +1526,27 @@ | ||
283 | tree_view->priv->destroy_count_data = NULL; | ||
284 | } | ||
285 | |||
286 | + if (tree_view->priv->first_drag_row) | ||
287 | + { | ||
288 | + gtk_tree_row_reference_free (tree_view->priv->first_drag_row); | ||
289 | + tree_view->priv->first_drag_row = NULL; | ||
290 | + } | ||
291 | + if (tree_view->priv->last_drag_row) | ||
292 | + { | ||
293 | + gtk_tree_row_reference_free (tree_view->priv->last_drag_row); | ||
294 | + tree_view->priv->last_drag_row = NULL; | ||
295 | + } | ||
296 | + if (tree_view->priv->queued_expand_row) | ||
297 | + { | ||
298 | + gtk_tree_row_reference_free (tree_view->priv->queued_expand_row); | ||
299 | + tree_view->priv->queued_expand_row = NULL; | ||
300 | + } | ||
301 | + if (tree_view->priv->queued_select_row) | ||
302 | + { | ||
303 | + gtk_tree_row_reference_free (tree_view->priv->queued_select_row); | ||
304 | + tree_view->priv->queued_select_row = NULL; | ||
305 | + } | ||
306 | + | ||
307 | gtk_tree_row_reference_free (tree_view->priv->cursor); | ||
308 | tree_view->priv->cursor = NULL; | ||
309 | |||
310 | @@ -1494,6 +1665,8 @@ | ||
311 | gtk_tree_view_map_buttons (tree_view); | ||
312 | |||
313 | gdk_window_show (widget->window); | ||
314 | + | ||
315 | + check_if_can_focus (tree_view); | ||
316 | } | ||
317 | |||
318 | static void | ||
319 | @@ -1895,6 +2068,8 @@ | ||
320 | gint full_requested_width = 0; | ||
321 | gint number_of_expand_columns = 0; | ||
322 | gboolean rtl; | ||
323 | + GtkWidget *scroll; | ||
324 | + GtkPolicyType ptype; | ||
325 | |||
326 | tree_view = GTK_TREE_VIEW (widget); | ||
327 | |||
328 | @@ -1969,6 +2144,19 @@ | ||
329 | allocation.x = width; | ||
330 | column->width = real_requested_width; | ||
331 | |||
332 | + /* a dirty Hildon hack to force truncation if not enough space. This hack is applied | ||
333 | + * only if we are NOT in a scrolled window with hscroll*/ | ||
334 | + scroll = gtk_widget_get_ancestor(widget, GTK_TYPE_SCROLLED_WINDOW); | ||
335 | + if ((!scroll || | ||
336 | + (gtk_scrolled_window_get_policy (GTK_SCROLLED_WINDOW (scroll), &ptype, NULL), ptype == GTK_POLICY_NEVER)) | ||
337 | + && (width + real_requested_width > widget->allocation.width)) | ||
338 | + { | ||
339 | + column->width = widget->allocation.width - width; | ||
340 | + if (column->width < 1) | ||
341 | + column->width = 1; | ||
342 | + gtk_widget_queue_draw (widget); | ||
343 | + } | ||
344 | + | ||
345 | if (column->expand) | ||
346 | { | ||
347 | if (number_of_expand_columns == 1) | ||
348 | @@ -2153,6 +2341,23 @@ | ||
349 | GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS); | ||
350 | } | ||
351 | |||
352 | +/* helper function for gtk_tree_view_button_press */ | ||
353 | +static void | ||
354 | +activate_callback (GtkTreeModel *model, | ||
355 | + GtkTreePath *path, | ||
356 | + GtkTreeIter *iter, | ||
357 | + gpointer data) | ||
358 | +{ | ||
359 | + GtkTreeView *tree_view = GTK_TREE_VIEW (data); | ||
360 | + | ||
361 | + /* Hildon: if the tree view has no active focus we don't activate | ||
362 | + * the selected row */ | ||
363 | + if ( !GTK_WIDGET_HAS_FOCUS (GTK_WIDGET(data)) ) | ||
364 | + return; | ||
365 | + | ||
366 | + gtk_tree_view_row_activated (tree_view, path, tree_view->priv->focus_column); | ||
367 | +} | ||
368 | + | ||
369 | static gboolean | ||
370 | gtk_tree_view_button_press (GtkWidget *widget, | ||
371 | GdkEventButton *event) | ||
372 | @@ -2166,6 +2371,7 @@ | ||
373 | gint vertical_separator; | ||
374 | gint horizontal_separator; | ||
375 | gboolean rtl; | ||
376 | + gint expander_indent; | ||
377 | |||
378 | g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE); | ||
379 | g_return_val_if_fail (event != NULL, FALSE); | ||
380 | @@ -2176,6 +2382,7 @@ | ||
381 | gtk_widget_style_get (widget, | ||
382 | "vertical_separator", &vertical_separator, | ||
383 | "horizontal_separator", &horizontal_separator, | ||
384 | + "expander_indent", &expander_indent, | ||
385 | NULL); | ||
386 | |||
387 | |||
388 | @@ -2199,6 +2406,14 @@ | ||
389 | gint column_handled_click = FALSE; | ||
390 | gboolean row_double_click = FALSE; | ||
391 | gboolean rtl; | ||
392 | + gboolean force_list_kludge; | ||
393 | + GtkRBNode *cursor = NULL; | ||
394 | + gboolean focus_grab = FALSE; | ||
395 | + | ||
396 | + if (!GTK_WIDGET_HAS_FOCUS (widget)) | ||
397 | + focus_grab = TRUE; | ||
398 | + | ||
399 | + GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS); | ||
400 | |||
401 | /* Empty tree? */ | ||
402 | if (tree_view->priv->tree == NULL) | ||
403 | @@ -2207,7 +2422,9 @@ | ||
404 | return TRUE; | ||
405 | } | ||
406 | |||
407 | - /* are we in an arrow? */ | ||
408 | + /* In Hildon we don't want to use the arrows */ | ||
409 | +#if 0 | ||
410 | + /* are we in an arrow? */ | ||
411 | if (tree_view->priv->prelight_node && | ||
412 | GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_ARROW_PRELIT)) | ||
413 | { | ||
414 | @@ -2226,6 +2443,7 @@ | ||
415 | grab_focus_and_unset_draw_keyfocus (tree_view); | ||
416 | return TRUE; | ||
417 | } | ||
418 | +#endif | ||
419 | |||
420 | /* find the node that was clicked */ | ||
421 | new_y = TREE_WINDOW_Y_TO_RBTREE_Y(tree_view, event->y); | ||
422 | @@ -2247,6 +2465,65 @@ | ||
423 | background_area.height = ROW_HEIGHT (tree_view, GTK_RBNODE_GET_HEIGHT (node)); | ||
424 | background_area.x = 0; | ||
425 | |||
426 | + if (tree_view->priv->first_drag_row) | ||
427 | + { | ||
428 | + gtk_tree_row_reference_free (tree_view->priv->first_drag_row); | ||
429 | + tree_view->priv->first_drag_row = NULL; | ||
430 | + } | ||
431 | + if (tree_view->priv->last_drag_row) | ||
432 | + { | ||
433 | + gtk_tree_row_reference_free (tree_view->priv->last_drag_row); | ||
434 | + tree_view->priv->last_drag_row = NULL; | ||
435 | + } | ||
436 | + tree_view->priv->first_drag_row = | ||
437 | + gtk_tree_row_reference_new (tree_view->priv->model, path); | ||
438 | + tree_view->priv->last_drag_row = gtk_tree_row_reference_copy (tree_view->priv->first_drag_row); | ||
439 | + | ||
440 | + /* force_list_kludge allows pen dragging even if | ||
441 | + GTK_TREE_MODEL_LIST_ONLY is not set (to fix file tree) */ | ||
442 | + g_object_get (widget, "force_list_kludge", &force_list_kludge, NULL); | ||
443 | + | ||
444 | + /* Hildon: activate pen dragging, if listbox is not hierarchical and | ||
445 | + the pen was not put down in a position that initiates drag'n'drop */ | ||
446 | + if (!tree_view->priv->pen_down && | ||
447 | + (force_list_kludge || | ||
448 | + (gtk_tree_model_get_flags(tree_view->priv->model) | ||
449 | + & GTK_TREE_MODEL_LIST_ONLY)) && | ||
450 | + (tree_view->priv->checkbox_mode || | ||
451 | + !gtk_tree_selection_path_is_selected(tree_view->priv->selection, path))) | ||
452 | + { | ||
453 | + gpointer drag_data; | ||
454 | + | ||
455 | + tree_view->priv->pen_down = TRUE; | ||
456 | + tree_view->priv->pen_focus = TRUE; | ||
457 | + | ||
458 | + /* also block attached dnd signal handler */ | ||
459 | + drag_data = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); | ||
460 | + if (drag_data) | ||
461 | + g_signal_handlers_block_matched (widget, | ||
462 | + G_SIGNAL_MATCH_DATA, | ||
463 | + 0, 0, NULL, NULL, | ||
464 | + drag_data); | ||
465 | + } | ||
466 | + | ||
467 | + /* For the Hildon buttonpress find out the previously selected row */ | ||
468 | + GtkRBTree *cursor_tree = NULL; | ||
469 | + GtkTreePath *cursor_path = NULL; | ||
470 | + | ||
471 | + if (tree_view->priv->cursor) | ||
472 | + { | ||
473 | + cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor); | ||
474 | + if (cursor_path) | ||
475 | + { | ||
476 | + _gtk_tree_view_find_node (tree_view, cursor_path, | ||
477 | + &cursor_tree, &cursor); | ||
478 | + gtk_tree_path_free (cursor_path); | ||
479 | + } | ||
480 | + } | ||
481 | + | ||
482 | + /* Hildon: in checkbox mode, dragging sets all checkboxes | ||
483 | + to the same state as the first toggled checkbox */ | ||
484 | + tree_view->priv->new_state = !gtk_tree_selection_path_is_selected(tree_view->priv->selection, path); | ||
485 | |||
486 | /* Let the column have a chance at selecting it. */ | ||
487 | rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL); | ||
488 | @@ -2275,8 +2552,11 @@ | ||
489 | if (gtk_tree_view_is_expander_column (tree_view, column) && | ||
490 | TREE_VIEW_DRAW_EXPANDERS(tree_view)) | ||
491 | { | ||
492 | - cell_area.x += depth * tree_view->priv->expander_size; | ||
493 | - cell_area.width -= depth * tree_view->priv->expander_size; | ||
494 | + gint adjust; | ||
495 | + | ||
496 | + adjust = depth * tree_view->priv->expander_size + (depth - 1) * expander_indent; | ||
497 | + cell_area.x += adjust; | ||
498 | + cell_area.width -= adjust; | ||
499 | } | ||
500 | break; | ||
501 | } | ||
502 | @@ -2364,15 +2644,19 @@ | ||
503 | */ | ||
504 | if (event->type == GDK_BUTTON_PRESS) | ||
505 | { | ||
506 | + /* Hildon: ignore Ctrl and Shift */ | ||
507 | +#if 0 | ||
508 | if ((event->state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK) | ||
509 | tree_view->priv->ctrl_pressed = TRUE; | ||
510 | if ((event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) | ||
511 | tree_view->priv->shift_pressed = TRUE; | ||
512 | +#endif | ||
513 | |||
514 | focus_cell = _gtk_tree_view_column_get_cell_at_pos (column, event->x - background_area.x); | ||
515 | if (focus_cell) | ||
516 | gtk_tree_view_column_focus_cell (column, focus_cell); | ||
517 | |||
518 | +#if 0 | ||
519 | if (event->state & GDK_CONTROL_MASK) | ||
520 | { | ||
521 | gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE); | ||
522 | @@ -2387,6 +2671,86 @@ | ||
523 | { | ||
524 | gtk_tree_view_real_set_cursor (tree_view, path, TRUE, TRUE); | ||
525 | } | ||
526 | +#endif | ||
527 | + if (tree_view->priv->checkbox_mode) | ||
528 | + { | ||
529 | + GtkRBTree *tree = NULL; | ||
530 | + GtkRBNode *node = NULL; | ||
531 | + | ||
532 | + _gtk_tree_view_find_node (tree_view, path, &tree, &node); | ||
533 | + | ||
534 | + /* cursor cannot move to an insensitive row, so we | ||
535 | + need to check here to avoid toggling the current | ||
536 | + row by clicking on an insensitive row */ | ||
537 | + if (_gtk_tree_selection_is_row_selectable (tree_view->priv->selection, | ||
538 | + node, path)) | ||
539 | + { | ||
540 | + gtk_tree_view_real_set_cursor (tree_view, path, | ||
541 | + FALSE, TRUE); | ||
542 | + gtk_tree_view_real_toggle_cursor_row (tree_view); | ||
543 | + } | ||
544 | + else | ||
545 | + /* Usually this would be emitted by real_set_cursor. | ||
546 | + However in this case we never call it. */ | ||
547 | + g_signal_emit (tree_view, tree_view_signals[ROW_INSENSITIVE], 0, path); | ||
548 | + } | ||
549 | + else | ||
550 | + { | ||
551 | + gboolean queue_row = TRUE; | ||
552 | + gboolean force_list_kludge; | ||
553 | + | ||
554 | + /* force_list_kludge allows rows to be activated even if | ||
555 | + GTK_TREE_MODEL_LIST_ONLY is not set (to fix file tree) */ | ||
556 | + g_object_get (widget, "force_list_kludge", | ||
557 | + &force_list_kludge, NULL); | ||
558 | + if ((force_list_kludge || | ||
559 | + (gtk_tree_model_get_flags (tree_view->priv->model) & | ||
560 | + GTK_TREE_MODEL_LIST_ONLY)) && | ||
561 | + gtk_tree_row_reference_valid (tree_view->priv->cursor)) | ||
562 | + { | ||
563 | + /* special case: text listbox without checkboxes | ||
564 | + should activate selected rows when user taps | ||
565 | + on cursor row, but not affect selection*/ | ||
566 | + GtkTreePath *cursor_path = | ||
567 | + gtk_tree_row_reference_get_path (tree_view->priv->cursor); | ||
568 | + if (gtk_tree_path_compare (cursor_path, path) == 0) | ||
569 | + { | ||
570 | + gtk_tree_selection_selected_foreach (tree_view->priv->selection, | ||
571 | + activate_callback, | ||
572 | + tree_view); | ||
573 | + queue_row = FALSE; | ||
574 | + } | ||
575 | + } | ||
576 | + | ||
577 | + if (queue_row && | ||
578 | + (gtk_tree_selection_get_mode (tree_view->priv->selection) == GTK_SELECTION_MULTIPLE) && | ||
579 | + gtk_tree_selection_path_is_selected (tree_view->priv->selection, path)) | ||
580 | + { | ||
581 | + GtkTreePath *old_cursor_path = NULL; | ||
582 | + | ||
583 | + /* we don't know if the user is selecting an item or performing | ||
584 | + multiple item drag and drop until we know where button is released */ | ||
585 | + if (tree_view->priv->queued_select_row) | ||
586 | + gtk_tree_row_reference_free (tree_view->priv->queued_select_row); | ||
587 | + tree_view->priv->queued_select_row = | ||
588 | + gtk_tree_row_reference_new (tree_view->priv->model, path); | ||
589 | + | ||
590 | + /* however, move focus */ | ||
591 | + if (tree_view->priv->cursor) | ||
592 | + { | ||
593 | + old_cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor); | ||
594 | + gtk_tree_row_reference_free (tree_view->priv->cursor); | ||
595 | + } | ||
596 | + tree_view->priv->cursor = gtk_tree_row_reference_new (tree_view->priv->model, | ||
597 | + path); | ||
598 | + gtk_tree_view_queue_draw_path (tree_view, path, NULL); | ||
599 | + if (old_cursor_path) | ||
600 | + gtk_tree_view_queue_draw_path (tree_view, old_cursor_path, NULL); | ||
601 | + } | ||
602 | + else | ||
603 | + gtk_tree_view_real_set_cursor (tree_view, path, | ||
604 | + queue_row, TRUE); | ||
605 | + } | ||
606 | |||
607 | tree_view->priv->ctrl_pressed = FALSE; | ||
608 | tree_view->priv->shift_pressed = FALSE; | ||
609 | @@ -2412,6 +2776,15 @@ | ||
610 | tree_view->priv->press_start_y = event->y; | ||
611 | } | ||
612 | |||
613 | + /* Hildon: if selected row is tapped -> the row gets activated and expands */ | ||
614 | + if (!focus_grab) | ||
615 | + { | ||
616 | + /* ...although not until button is released */ | ||
617 | + gtk_tree_row_reference_free (tree_view->priv->queued_expand_row); | ||
618 | + tree_view->priv->queued_expand_row = | ||
619 | + gtk_tree_row_reference_new (tree_view->priv->model, path); | ||
620 | + } | ||
621 | + | ||
622 | /* Test if a double click happened on the same row. */ | ||
623 | if (event->button == 1) | ||
624 | { | ||
625 | @@ -2433,6 +2806,8 @@ | ||
626 | } | ||
627 | } | ||
628 | |||
629 | + /* Hildon doesn't support double clicks */ | ||
630 | +#if 0 | ||
631 | if (row_double_click) | ||
632 | { | ||
633 | if (tree_view->priv->last_button_press) | ||
634 | @@ -2443,6 +2818,7 @@ | ||
635 | tree_view->priv->last_button_press_2 = NULL; | ||
636 | } | ||
637 | else | ||
638 | +#endif | ||
639 | { | ||
640 | if (tree_view->priv->last_button_press) | ||
641 | gtk_tree_row_reference_free (tree_view->priv->last_button_press); | ||
642 | @@ -2626,6 +3002,28 @@ | ||
643 | |||
644 | tree_view = GTK_TREE_VIEW (widget); | ||
645 | |||
646 | + /* unblock attached dnd signal handler */ | ||
647 | + if (tree_view->priv->pen_down) | ||
648 | + { | ||
649 | + gpointer drag_data = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); | ||
650 | + if (drag_data) | ||
651 | + g_signal_handlers_unblock_matched (widget, | ||
652 | + G_SIGNAL_MATCH_DATA, | ||
653 | + 0, 0, NULL, NULL, | ||
654 | + drag_data); | ||
655 | + } | ||
656 | + | ||
657 | + /* stop pen dragging */ | ||
658 | + if (tree_view->priv->first_drag_row) | ||
659 | + gtk_tree_row_reference_free (tree_view->priv->first_drag_row); | ||
660 | + if (tree_view->priv->last_drag_row) | ||
661 | + gtk_tree_row_reference_free (tree_view->priv->last_drag_row); | ||
662 | + tree_view->priv->first_drag_row = NULL; | ||
663 | + tree_view->priv->last_drag_row = NULL; | ||
664 | + tree_view->priv->pen_down = FALSE; | ||
665 | + tree_view->priv->pen_drag_active = FALSE; | ||
666 | + remove_scroll_timeout (tree_view); | ||
667 | + | ||
668 | if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG)) | ||
669 | return gtk_tree_view_button_release_drag_column (widget, event); | ||
670 | |||
671 | @@ -2635,6 +3033,65 @@ | ||
672 | if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE)) | ||
673 | return gtk_tree_view_button_release_column_resize (widget, event); | ||
674 | |||
675 | + if (gtk_tree_row_reference_valid (tree_view->priv->queued_select_row)) | ||
676 | + { | ||
677 | + /* unselect other nodes - but only if not drag'n'dropping */ | ||
678 | + if (event->window == tree_view->priv->bin_window) | ||
679 | + gtk_tree_selection_unselect_all (tree_view->priv->selection); | ||
680 | + | ||
681 | + gtk_tree_view_real_set_cursor (tree_view, | ||
682 | + gtk_tree_row_reference_get_path (tree_view->priv->queued_select_row), | ||
683 | + FALSE, TRUE); | ||
684 | + gtk_tree_row_reference_free (tree_view->priv->queued_select_row); | ||
685 | + tree_view->priv->queued_select_row = NULL; | ||
686 | + } | ||
687 | + | ||
688 | + /* for handling expand/collapse postponed from button_press (since we | ||
689 | + don't want expand/collapse before tap on node has been completed) */ | ||
690 | + if (gtk_tree_row_reference_valid (tree_view->priv->queued_expand_row) && | ||
691 | + tree_view->priv->tree != NULL) | ||
692 | + { | ||
693 | + GtkTreePath *queued_expand_path; | ||
694 | + GtkRBTree *tree; | ||
695 | + GtkRBNode *node; | ||
696 | + GtkRBNode *old_node; | ||
697 | + gint y; | ||
698 | + | ||
699 | + queued_expand_path = | ||
700 | + gtk_tree_row_reference_get_path (tree_view->priv->queued_expand_row); | ||
701 | + | ||
702 | + if (queued_expand_path) | ||
703 | + { | ||
704 | + /* must check that cursor hasn't moved elsewhere since button_press */ | ||
705 | + y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, event->y); | ||
706 | + _gtk_rbtree_find_offset (tree_view->priv->tree, y, &tree, &node); | ||
707 | + | ||
708 | + _gtk_tree_view_find_node (tree_view, queued_expand_path, | ||
709 | + &tree, &old_node); | ||
710 | + | ||
711 | + if (node && old_node == node) | ||
712 | + { | ||
713 | + if (node->children == NULL) | ||
714 | + gtk_tree_view_real_expand_row (tree_view, | ||
715 | + queued_expand_path, | ||
716 | + tree, | ||
717 | + node, | ||
718 | + FALSE, TRUE); | ||
719 | + else | ||
720 | + gtk_tree_view_real_collapse_row (tree_view, | ||
721 | + queued_expand_path, | ||
722 | + tree, | ||
723 | + node, | ||
724 | + TRUE); | ||
725 | + } | ||
726 | + | ||
727 | + gtk_tree_path_free (queued_expand_path); | ||
728 | + } | ||
729 | + | ||
730 | + gtk_tree_row_reference_free( tree_view->priv->queued_expand_row); | ||
731 | + tree_view->priv->queued_expand_row = NULL; | ||
732 | + } | ||
733 | + | ||
734 | if (tree_view->priv->button_pressed_node == NULL) | ||
735 | return FALSE; | ||
736 | |||
737 | @@ -3311,6 +3768,7 @@ | ||
738 | GtkTreeView *tree_view; | ||
739 | GtkRBTree *tree; | ||
740 | GtkRBNode *node; | ||
741 | + GtkTreePath *path, *last_drag_path, *current_path; | ||
742 | gint new_y; | ||
743 | |||
744 | tree_view = (GtkTreeView *) widget; | ||
745 | @@ -3319,7 +3777,8 @@ | ||
746 | return FALSE; | ||
747 | |||
748 | /* only check for an initiated drag when a button is pressed */ | ||
749 | - if (tree_view->priv->pressed_button >= 0) | ||
750 | + /* Hildon: active pen drag overrides drag and drop */ | ||
751 | + if (tree_view->priv->pressed_button >= 0 && !tree_view->priv->pen_down) | ||
752 | gtk_tree_view_maybe_begin_dragging_row (tree_view, event); | ||
753 | |||
754 | new_y = TREE_WINDOW_Y_TO_RBTREE_Y(tree_view, event->y); | ||
755 | @@ -3328,6 +3787,99 @@ | ||
756 | |||
757 | _gtk_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node); | ||
758 | |||
759 | + /* Hildon: pen dragging */ | ||
760 | + if (tree_view->priv->pen_down && node != NULL && | ||
761 | + tree_view->priv->queued_select_row == NULL && | ||
762 | + gtk_tree_row_reference_valid (tree_view->priv->last_drag_row)) | ||
763 | + { | ||
764 | + gint direction; | ||
765 | + | ||
766 | + last_drag_path = gtk_tree_row_reference_get_path (tree_view->priv->last_drag_row); | ||
767 | + path = _gtk_tree_view_find_path (tree_view, tree, node); | ||
768 | + direction = gtk_tree_path_compare (path, last_drag_path); | ||
769 | + | ||
770 | + if (direction != 0) | ||
771 | + { | ||
772 | + current_path = gtk_tree_path_copy (last_drag_path); | ||
773 | + | ||
774 | + /* we must ensure that no row is skipped because stylus | ||
775 | + is moving faster than motion events are generated */ | ||
776 | + do { | ||
777 | + if (direction > 0) | ||
778 | + { | ||
779 | + /* gtk_tree_path_next does not let us know when it failed */ | ||
780 | + GtkTreeIter iter; | ||
781 | + gtk_tree_model_get_iter (tree_view->priv->model, &iter, current_path); | ||
782 | + if (!gtk_tree_model_iter_next (tree_view->priv->model, &iter)) | ||
783 | + break; | ||
784 | + | ||
785 | + gtk_tree_path_next (current_path); | ||
786 | + } | ||
787 | + else if (!gtk_tree_path_prev (current_path)) | ||
788 | + break; | ||
789 | + | ||
790 | + /* set cursor, and start scrolling */ | ||
791 | + gtk_tree_view_real_set_cursor (tree_view, current_path, FALSE, FALSE); | ||
792 | + add_scroll_timeout (tree_view); | ||
793 | + | ||
794 | + if (tree_view->priv->checkbox_mode) | ||
795 | + { | ||
796 | + /* always set to same state as the first tapped node */ | ||
797 | + if (tree_view->priv->new_state) | ||
798 | + gtk_tree_selection_select_path (tree_view->priv->selection, | ||
799 | + current_path); | ||
800 | + else | ||
801 | + gtk_tree_selection_unselect_path (tree_view->priv->selection, | ||
802 | + current_path); | ||
803 | + } | ||
804 | + else | ||
805 | + { | ||
806 | + if (gtk_tree_selection_path_is_selected (tree_view->priv->selection, | ||
807 | + current_path)) | ||
808 | + { | ||
809 | + /* apparently we have reversed the pen drag direction */ | ||
810 | + GtkTreePath *reverse_path; | ||
811 | + gint reverse_direction; | ||
812 | + | ||
813 | + reverse_direction = gtk_tree_path_compare (current_path, | ||
814 | + last_drag_path); | ||
815 | + reverse_path = gtk_tree_path_copy (last_drag_path); | ||
816 | + do { | ||
817 | + gtk_tree_selection_unselect_path (tree_view->priv->selection, | ||
818 | + reverse_path); | ||
819 | + tree_view->priv->pen_drag_reverse = TRUE; | ||
820 | + if (reverse_direction > 0) | ||
821 | + { | ||
822 | + GtkTreeIter iter; | ||
823 | + gtk_tree_model_get_iter (tree_view->priv->model, &iter, reverse_path); | ||
824 | + if (!gtk_tree_model_iter_next (tree_view->priv->model, &iter)) | ||
825 | + break; | ||
826 | + | ||
827 | + gtk_tree_path_next (reverse_path); | ||
828 | + } | ||
829 | + else if (!gtk_tree_path_prev (reverse_path)) | ||
830 | + break; | ||
831 | + } while (gtk_tree_path_compare (reverse_path, current_path) != 0); | ||
832 | + gtk_tree_path_free (reverse_path); | ||
833 | + } | ||
834 | + else | ||
835 | + { | ||
836 | + gtk_tree_selection_select_path (tree_view->priv->selection, | ||
837 | + current_path); | ||
838 | + tree_view->priv->pen_drag_reverse = FALSE; | ||
839 | + } | ||
840 | + } | ||
841 | + } while (gtk_tree_path_compare(current_path, path) != 0); | ||
842 | + gtk_tree_path_free (current_path); | ||
843 | + | ||
844 | + /* update last_drag_row */ | ||
845 | + gtk_tree_row_reference_free (tree_view->priv->last_drag_row); | ||
846 | + tree_view->priv->last_drag_row = | ||
847 | + gtk_tree_row_reference_new (tree_view->priv->model, path); | ||
848 | + gtk_tree_path_free (path); | ||
849 | + } | ||
850 | + } | ||
851 | + | ||
852 | /* If we are currently pressing down a button, we don't want to prelight anything else. */ | ||
853 | if ((tree_view->priv->button_pressed_node != NULL) && | ||
854 | (tree_view->priv->button_pressed_node != node)) | ||
855 | @@ -3404,6 +3956,22 @@ | ||
856 | 1, 1, w, h); | ||
857 | } | ||
858 | |||
859 | +/* Hildon: helper function for dotted slash drawing; | ||
860 | + returns TRUE or FALSE, depending it there are | ||
861 | + more nodes at current level */ | ||
862 | +static gboolean | ||
863 | +iter_has_next (GtkTreeModel *model, GtkTreeIter *iter) | ||
864 | +{ | ||
865 | + GtkTreeIter *check_iter; | ||
866 | + gboolean result; | ||
867 | + | ||
868 | + check_iter = gtk_tree_iter_copy(iter); | ||
869 | + result = gtk_tree_model_iter_next (model, check_iter); | ||
870 | + | ||
871 | + gtk_tree_iter_free (check_iter); | ||
872 | + return result; | ||
873 | +} | ||
874 | + | ||
875 | /* Warning: Very scary function. | ||
876 | * Modify at your own risk | ||
877 | * | ||
878 | @@ -3433,16 +4001,25 @@ | ||
879 | guint flags; | ||
880 | gint highlight_x; | ||
881 | gint bin_window_width; | ||
882 | - GtkTreePath *cursor_path; | ||
883 | - GtkTreePath *drag_dest_path; | ||
884 | + GtkTreePath *cursor_path = NULL; | ||
885 | + GtkTreePath *drag_dest_path = NULL; | ||
886 | GList *last_column; | ||
887 | gint vertical_separator; | ||
888 | gint horizontal_separator; | ||
889 | + gint expander_indent; | ||
890 | gint focus_line_width; | ||
891 | gboolean allow_rules; | ||
892 | gboolean has_special_cell; | ||
893 | gboolean rtl; | ||
894 | gint n_visible_columns; | ||
895 | + gboolean dottedlines, passivefocus, res; | ||
896 | + | ||
897 | + /* Hildon: these variables are added for dotted slash drawing | ||
898 | + (Hierarchical listbox) */ | ||
899 | + gint i; | ||
900 | + gint node_elements = 64; | ||
901 | + gboolean *iter_value = NULL; | ||
902 | + GtkTreeIter node_iter, parent_iter; | ||
903 | |||
904 | g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE); | ||
905 | |||
906 | @@ -3455,8 +4032,12 @@ | ||
907 | "vertical_separator", &vertical_separator, | ||
908 | "allow_rules", &allow_rules, | ||
909 | "focus-line-width", &focus_line_width, | ||
910 | + "expander_indent", &expander_indent, | ||
911 | + "passive_focus", &passivefocus, | ||
912 | NULL); | ||
913 | |||
914 | + g_object_get (widget, "dotted_lines", &dottedlines, NULL); | ||
915 | + | ||
916 | if (tree_view->priv->tree == NULL) | ||
917 | { | ||
918 | draw_empty_focus (tree_view, &event->area); | ||
919 | @@ -3478,6 +4059,8 @@ | ||
920 | if (node == NULL) | ||
921 | return TRUE; | ||
922 | |||
923 | + iter_value = g_new (gboolean, node_elements); | ||
924 | + | ||
925 | /* find the path for the node */ | ||
926 | path = _gtk_tree_view_find_path ((GtkTreeView *)widget, | ||
927 | tree, | ||
928 | @@ -3486,11 +4069,25 @@ | ||
929 | &iter, | ||
930 | path); | ||
931 | depth = gtk_tree_path_get_depth (path); | ||
932 | + | ||
933 | + node_iter = iter; | ||
934 | + for (i = depth - 1; i >= 1; i--) | ||
935 | + { | ||
936 | + res = gtk_tree_model_iter_parent (tree_view->priv->model, &parent_iter, &node_iter); | ||
937 | + /* Check, if we should grow array */ | ||
938 | + if (i >= node_elements - 1) | ||
939 | + { | ||
940 | + node_elements *= 2; | ||
941 | + iter_value = g_renew (gboolean, iter_value, node_elements); | ||
942 | + if (!iter_value) | ||
943 | + goto done; | ||
944 | + } | ||
945 | + iter_value[i] = iter_has_next (tree_view->priv->model, &parent_iter); | ||
946 | + node_iter = parent_iter; | ||
947 | + } | ||
948 | + gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); | ||
949 | gtk_tree_path_free (path); | ||
950 | |||
951 | - cursor_path = NULL; | ||
952 | - drag_dest_path = NULL; | ||
953 | - | ||
954 | if (tree_view->priv->cursor) | ||
955 | cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor); | ||
956 | |||
957 | @@ -3533,6 +4130,7 @@ | ||
958 | do | ||
959 | { | ||
960 | gboolean parity; | ||
961 | + gboolean is_first = TRUE; | ||
962 | gboolean is_separator = FALSE; | ||
963 | |||
964 | if (tree_view->priv->row_separator_func) | ||
965 | @@ -3570,6 +4168,7 @@ | ||
966 | GtkTreeViewColumn *column = list->data; | ||
967 | const gchar *detail = NULL; | ||
968 | GtkStateType state; | ||
969 | + gboolean is_last = (rtl ? !list->prev : !list->next); | ||
970 | |||
971 | if (!column->visible) | ||
972 | continue; | ||
973 | @@ -3660,31 +4259,152 @@ | ||
974 | else | ||
975 | state = GTK_STATE_NORMAL; | ||
976 | |||
977 | - /* Draw background */ | ||
978 | - gtk_paint_flat_box (widget->style, | ||
979 | - event->window, | ||
980 | - state, | ||
981 | - GTK_SHADOW_NONE, | ||
982 | - &event->area, | ||
983 | - widget, | ||
984 | - detail, | ||
985 | - background_area.x, | ||
986 | - background_area.y, | ||
987 | - background_area.width, | ||
988 | - background_area.height); | ||
989 | + if (tree_view->priv->pen_focus) | ||
990 | + { | ||
991 | + if (node != cursor || | ||
992 | + (!GTK_WIDGET_HAS_FOCUS (widget) && !passivefocus)) | ||
993 | + { | ||
994 | + if ((flags & GTK_CELL_RENDERER_SELECTED) | ||
995 | + && !tree_view->priv->checkbox_mode) | ||
996 | + state = GTK_STATE_SELECTED; | ||
997 | + else | ||
998 | + state = GTK_STATE_NORMAL; | ||
999 | + | ||
1000 | + /* Draw background */ | ||
1001 | + gtk_paint_flat_box (widget->style, | ||
1002 | + event->window, | ||
1003 | + state, | ||
1004 | + GTK_SHADOW_NONE, | ||
1005 | + &event->area, | ||
1006 | + widget, | ||
1007 | + detail, | ||
1008 | + background_area.x, | ||
1009 | + background_area.y, | ||
1010 | + background_area.width, | ||
1011 | + background_area.height); | ||
1012 | + } | ||
1013 | + else if ((flags & GTK_CELL_RENDERER_SELECTED) && | ||
1014 | + !tree_view->priv->checkbox_mode && | ||
1015 | + node != cursor) | ||
1016 | + { | ||
1017 | + gtk_paint_flat_box (widget->style, | ||
1018 | + event->window, | ||
1019 | + GTK_STATE_SELECTED, | ||
1020 | + GTK_SHADOW_NONE, | ||
1021 | + &event->area, | ||
1022 | + widget, | ||
1023 | + detail, | ||
1024 | + background_area.x, | ||
1025 | + background_area.y, | ||
1026 | + background_area.width, | ||
1027 | + background_area.height); | ||
1028 | + } | ||
1029 | + } | ||
1030 | + else | ||
1031 | + { | ||
1032 | + /* Draw background */ | ||
1033 | + gtk_paint_flat_box (widget->style, | ||
1034 | + event->window, | ||
1035 | + state, | ||
1036 | + GTK_SHADOW_NONE, | ||
1037 | + &event->area, | ||
1038 | + widget, | ||
1039 | + detail, | ||
1040 | + background_area.x, | ||
1041 | + background_area.y, | ||
1042 | + background_area.width, | ||
1043 | + background_area.height); | ||
1044 | + } | ||
1045 | + | ||
1046 | + /* Hildon change: drawing focus is moved here because it didn't work | ||
1047 | + properly before. Some changes where also made.*/ | ||
1048 | + /* draw the big row-spanning focus rectangle, if needed */ | ||
1049 | + if (node == cursor && | ||
1050 | + (!passivefocus || GTK_WIDGET_HAS_FOCUS (widget))) | ||
1051 | + { | ||
1052 | + gtk_paint_focus (widget->style, | ||
1053 | + event->window, | ||
1054 | + GTK_STATE_ACTIVE, | ||
1055 | + &event->area, | ||
1056 | + widget, | ||
1057 | + (is_first | ||
1058 | + ? (is_last ? "full" : "left") | ||
1059 | + : (is_last ? "right" : "middle")), | ||
1060 | + background_area.x - (is_first ? 0 : horizontal_separator / 2), | ||
1061 | + background_area.y - vertical_separator / 2, | ||
1062 | + background_area.width + (is_first ? 0 : (is_last ? horizontal_separator / 2 : horizontal_separator)), | ||
1063 | + background_area.height + vertical_separator); | ||
1064 | + | ||
1065 | + is_first = FALSE; | ||
1066 | + } | ||
1067 | + else if (node == cursor && passivefocus && | ||
1068 | + !GTK_WIDGET_HAS_FOCUS (widget)) | ||
1069 | + { | ||
1070 | + GtkStyle *style = gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget), | ||
1071 | + "hildon-focus", | ||
1072 | + NULL, | ||
1073 | + G_TYPE_NONE); | ||
1074 | + gtk_style_attach (style, event->window); | ||
1075 | + | ||
1076 | + gtk_paint_focus (style, event->window, GTK_STATE_SELECTED, | ||
1077 | + &event->area, widget, | ||
1078 | + (is_first | ||
1079 | + ? (is_last ? "full" : "left") | ||
1080 | + : (is_last ? "right" : "middle")), | ||
1081 | + background_area.x - (is_first ? 0 : horizontal_separator / 2), | ||
1082 | + background_area.y - vertical_separator / 2, | ||
1083 | + background_area.width + (is_first ? 0 : (is_last ? horizontal_separator / 2 : horizontal_separator)), | ||
1084 | + background_area.height + vertical_separator); | ||
1085 | + | ||
1086 | + is_first = FALSE; | ||
1087 | + } | ||
1088 | + | ||
1089 | + if (node == cursor) | ||
1090 | + { | ||
1091 | + gint width, x_offset; | ||
1092 | + GtkStateType focus_rect_state; | ||
1093 | + focus_rect_state = | ||
1094 | + flags & GTK_CELL_RENDERER_FOCUSED ? GTK_STATE_ACTIVE : | ||
1095 | + (flags & GTK_CELL_RENDERER_PRELIT ? GTK_STATE_PRELIGHT : | ||
1096 | + (flags & GTK_CELL_RENDERER_INSENSITIVE ? GTK_STATE_INSENSITIVE : | ||
1097 | + (flags & GTK_CELL_RENDERER_SELECTED ? GTK_STATE_SELECTED : | ||
1098 | + GTK_STATE_NORMAL))); | ||
1099 | + | ||
1100 | + gtk_tree_view_get_arrow_xrange (tree_view, tree, &x_offset, NULL); | ||
1101 | + gdk_drawable_get_size (tree_view->priv->bin_window, &width, NULL); | ||
1102 | + } | ||
1103 | |||
1104 | if (gtk_tree_view_is_expander_column (tree_view, column) && | ||
1105 | TREE_VIEW_DRAW_EXPANDERS(tree_view)) | ||
1106 | { | ||
1107 | + gint px, px2, py, i; | ||
1108 | + | ||
1109 | + if (depth <= 1) | ||
1110 | + px = 0; | ||
1111 | + else | ||
1112 | + px = (depth - 1) * tree_view->priv->expander_size + | ||
1113 | + (depth - 2) * expander_indent; | ||
1114 | + | ||
1115 | + /* Hildonlike hack for making the indent look better. | ||
1116 | + * indent is added to all rows except the first one */ | ||
1117 | + | ||
1118 | if (!rtl) | ||
1119 | - cell_area.x += depth * tree_view->priv->expander_size; | ||
1120 | - cell_area.width -= depth * tree_view->priv->expander_size; | ||
1121 | + cell_area.x += depth * tree_view->priv->expander_size + (depth-1) * expander_indent; | ||
1122 | + cell_area.width -= depth * tree_view->priv->expander_size + (depth-1) * expander_indent; | ||
1123 | |||
1124 | /* If we have an expander column, the highlight underline | ||
1125 | * starts with that column, so that it indicates which | ||
1126 | * level of the tree we're dropping at. | ||
1127 | */ | ||
1128 | highlight_x = cell_area.x; | ||
1129 | + | ||
1130 | + if (!GTK_WIDGET_IS_SENSITIVE (widget)) | ||
1131 | + { | ||
1132 | + flags &= ~ (GTK_CELL_RENDERER_PRELIT + GTK_CELL_RENDERER_INSENSITIVE + | ||
1133 | + GTK_CELL_RENDERER_FOCUSED); | ||
1134 | + flags &= GTK_CELL_RENDERER_INSENSITIVE; | ||
1135 | + } | ||
1136 | + | ||
1137 | if (is_separator) | ||
1138 | gtk_paint_hline (widget->style, | ||
1139 | event->window, | ||
1140 | @@ -3702,6 +4422,48 @@ | ||
1141 | &cell_area, | ||
1142 | &event->area, | ||
1143 | flags); | ||
1144 | + | ||
1145 | + /* Hildon dotted slash line drawing for Hierarchical Listbox | ||
1146 | + widget */ | ||
1147 | + if (dottedlines) | ||
1148 | + { | ||
1149 | + py = cell_area.y + cell_area.height / 2; | ||
1150 | + px2 = depth * tree_view->priv->expander_size + | ||
1151 | + (depth - 1) * expander_indent; | ||
1152 | + | ||
1153 | + gdk_gc_set_line_attributes (widget->style->fg_gc[GTK_WIDGET_STATE (widget)], | ||
1154 | + 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_BEVEL); | ||
1155 | + | ||
1156 | + gdk_draw_line (tree_view->priv->bin_window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], | ||
1157 | + px, py, px2, py); | ||
1158 | + | ||
1159 | + if (depth > 1) | ||
1160 | + { | ||
1161 | + gdk_draw_line (tree_view->priv->bin_window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], | ||
1162 | + px, cell_area.y, px, py); | ||
1163 | + if (iter_has_next (tree_view->priv->model, &iter)) | ||
1164 | + { | ||
1165 | + gdk_draw_line (tree_view->priv->bin_window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], | ||
1166 | + px, py, px, cell_area.y + cell_area.height); | ||
1167 | + } | ||
1168 | + } | ||
1169 | + | ||
1170 | + if (node->children) | ||
1171 | + { | ||
1172 | + gdk_draw_line (tree_view->priv->bin_window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], | ||
1173 | + px2, py, px2, cell_area.y + cell_area.height); | ||
1174 | + } | ||
1175 | + for (i = depth - 1; i >= 2; i--) | ||
1176 | + { | ||
1177 | + if (iter_value[i]) | ||
1178 | + { | ||
1179 | + px = (i - 1)* tree_view->priv->expander_size + (i - 2) * expander_indent; | ||
1180 | + gdk_draw_line (tree_view->priv->bin_window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], | ||
1181 | + px, cell_area.y, px, cell_area.y + cell_area.height); | ||
1182 | + } | ||
1183 | + } | ||
1184 | + } | ||
1185 | + | ||
1186 | if ((node->flags & GTK_RBNODE_IS_PARENT) == GTK_RBNODE_IS_PARENT) | ||
1187 | { | ||
1188 | gint x, y; | ||
1189 | @@ -3803,6 +4565,8 @@ | ||
1190 | } | ||
1191 | } | ||
1192 | |||
1193 | + /* Hildon: disabled this */ | ||
1194 | +#if 0 | ||
1195 | /* draw the big row-spanning focus rectangle, if needed */ | ||
1196 | if (!has_special_cell && node == cursor && | ||
1197 | GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS) && | ||
1198 | @@ -3830,6 +4594,7 @@ | ||
1199 | width, | ||
1200 | ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node))); | ||
1201 | } | ||
1202 | +#endif | ||
1203 | |||
1204 | y_offset += max_height; | ||
1205 | if (node->children) | ||
1206 | @@ -3847,6 +4612,17 @@ | ||
1207 | has_child = gtk_tree_model_iter_children (tree_view->priv->model, | ||
1208 | &iter, | ||
1209 | &parent); | ||
1210 | + | ||
1211 | + /* Check if we need to grow array */ | ||
1212 | + if (depth >= node_elements - 1) | ||
1213 | + { | ||
1214 | + node_elements *= 2; | ||
1215 | + iter_value = g_renew (gboolean, iter_value, node_elements); | ||
1216 | + if (!iter_value) | ||
1217 | + goto done; | ||
1218 | + } | ||
1219 | + iter_value[depth] = iter_has_next (tree_view->priv->model, &parent); | ||
1220 | + | ||
1221 | depth++; | ||
1222 | |||
1223 | /* Sanity Check! */ | ||
1224 | @@ -3897,6 +4673,9 @@ | ||
1225 | if (drag_dest_path) | ||
1226 | gtk_tree_path_free (drag_dest_path); | ||
1227 | |||
1228 | + if (iter_value) | ||
1229 | + g_free (iter_value); | ||
1230 | + | ||
1231 | return FALSE; | ||
1232 | } | ||
1233 | |||
1234 | @@ -4179,6 +4958,63 @@ | ||
1235 | |||
1236 | rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL); | ||
1237 | |||
1238 | + /* Special Hildon keyboard interactions */ | ||
1239 | + if (event->keyval == GDK_Escape) | ||
1240 | + gtk_tree_selection_unselect_all (tree_view->priv->selection); | ||
1241 | + | ||
1242 | + if (event->keyval == GDK_Return && | ||
1243 | + gtk_tree_row_reference_valid (tree_view->priv->cursor)) | ||
1244 | + { | ||
1245 | + gboolean force_list_kludge; | ||
1246 | + | ||
1247 | + g_object_get (widget, "force_list_kludge", &force_list_kludge, NULL); | ||
1248 | + if (force_list_kludge || | ||
1249 | + (gtk_tree_model_get_flags (tree_view->priv->model) & | ||
1250 | + GTK_TREE_MODEL_LIST_ONLY)) | ||
1251 | + { | ||
1252 | + /* text listbox */ | ||
1253 | + if (tree_view->priv->checkbox_mode) | ||
1254 | + { | ||
1255 | + /* multisel with checkboxes: select key toggles focused */ | ||
1256 | + gtk_tree_view_real_toggle_cursor_row (tree_view); | ||
1257 | + } | ||
1258 | + else | ||
1259 | + { | ||
1260 | + /* no checkboxes: select key activates focused */ | ||
1261 | + GtkTreePath *cursor_path = | ||
1262 | + gtk_tree_row_reference_get_path (tree_view->priv->cursor); | ||
1263 | + | ||
1264 | + gtk_tree_view_row_activated (tree_view, cursor_path, | ||
1265 | + tree_view->priv->focus_column); | ||
1266 | + | ||
1267 | + gtk_tree_path_free (cursor_path); | ||
1268 | + } | ||
1269 | + } | ||
1270 | + else | ||
1271 | + { | ||
1272 | + /* hierarchical listbox */ | ||
1273 | + GtkTreePath *cursor_path; | ||
1274 | + GtkRBTree *tree; | ||
1275 | + GtkRBNode *node; | ||
1276 | + | ||
1277 | + cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor); | ||
1278 | + _gtk_tree_view_find_node (tree_view, cursor_path, &tree, &node); | ||
1279 | + | ||
1280 | + if (node->children == NULL) | ||
1281 | + gtk_tree_view_real_expand_row (tree_view, | ||
1282 | + cursor_path, | ||
1283 | + tree, | ||
1284 | + node, | ||
1285 | + FALSE, TRUE); | ||
1286 | + else | ||
1287 | + gtk_tree_view_real_collapse_row (tree_view, | ||
1288 | + cursor_path, | ||
1289 | + tree, | ||
1290 | + node, | ||
1291 | + TRUE); | ||
1292 | + } | ||
1293 | + } | ||
1294 | + | ||
1295 | if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG)) | ||
1296 | { | ||
1297 | if (event->keyval == GDK_Escape) | ||
1298 | @@ -4420,6 +5256,7 @@ | ||
1299 | |||
1300 | /* FIXME Is this function necessary? Can I get an enter_notify event | ||
1301 | * w/o either an expose event or a mouse motion event? | ||
1302 | + * Hildon => it is necessary to make pen dragging work correctly | ||
1303 | */ | ||
1304 | static gboolean | ||
1305 | gtk_tree_view_enter_notify (GtkWidget *widget, | ||
1306 | @@ -4434,6 +5271,10 @@ | ||
1307 | |||
1308 | tree_view = GTK_TREE_VIEW (widget); | ||
1309 | |||
1310 | + /* stop "automatic" pen dragging */ | ||
1311 | + tree_view->priv->pen_drag_active = FALSE; | ||
1312 | + remove_scroll_timeout (tree_view); | ||
1313 | + | ||
1314 | /* Sanity check it */ | ||
1315 | if (event->window != tree_view->priv->bin_window) | ||
1316 | return FALSE; | ||
1317 | @@ -4463,6 +5304,9 @@ | ||
1318 | tree_view = GTK_TREE_VIEW (widget); | ||
1319 | tree_view->priv->pressed_button = -1; | ||
1320 | |||
1321 | + if (tree_view->priv->pen_down && tree_view->priv->queued_select_row == NULL) | ||
1322 | + tree_view->priv->pen_drag_active = TRUE; | ||
1323 | + | ||
1324 | if (event->mode == GDK_CROSSING_GRAB) | ||
1325 | return TRUE; | ||
1326 | |||
1327 | @@ -4535,6 +5379,7 @@ | ||
1328 | gboolean retval = FALSE; | ||
1329 | gboolean is_separator = FALSE; | ||
1330 | gint focus_pad; | ||
1331 | + gint expander_indent; | ||
1332 | |||
1333 | /* double check the row needs validating */ | ||
1334 | if (! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_INVALID) && | ||
1335 | @@ -4551,6 +5396,7 @@ | ||
1336 | gtk_widget_style_get (GTK_WIDGET (tree_view), | ||
1337 | "focus-padding", &focus_pad, | ||
1338 | "horizontal_separator", &horizontal_separator, | ||
1339 | + "expander_indent", &expander_indent, | ||
1340 | NULL); | ||
1341 | |||
1342 | for (list = tree_view->priv->columns; list; list = list->next) | ||
1343 | @@ -4577,13 +5423,16 @@ | ||
1344 | { | ||
1345 | height = MAX (height, tmp_height); | ||
1346 | height = MAX (height, tree_view->priv->expander_size); | ||
1347 | + | ||
1348 | + /* Hildon addition */ | ||
1349 | + height -= 1; | ||
1350 | } | ||
1351 | else | ||
1352 | height = 2 + 2 * focus_pad; | ||
1353 | |||
1354 | if (gtk_tree_view_is_expander_column (tree_view, column) && TREE_VIEW_DRAW_EXPANDERS (tree_view)) | ||
1355 | { | ||
1356 | - tmp_width = tmp_width + horizontal_separator + depth * (tree_view->priv->expander_size); | ||
1357 | + tmp_width = tmp_width + horizontal_separator + depth * (tree_view->priv->expander_size) + (depth - 1) * expander_indent; | ||
1358 | } | ||
1359 | else | ||
1360 | tmp_width = tmp_width + horizontal_separator; | ||
1361 | @@ -5585,6 +6434,16 @@ | ||
1362 | #endif /* 0 */ | ||
1363 | |||
1364 | static void | ||
1365 | +add_scroll_timeout (GtkTreeView *tree_view) | ||
1366 | +{ | ||
1367 | + if (tree_view->priv->scroll_timeout == 0) | ||
1368 | + { | ||
1369 | + tree_view->priv->scroll_timeout = | ||
1370 | + g_timeout_add (150, scroll_row_timeout, tree_view); | ||
1371 | + } | ||
1372 | +} | ||
1373 | + | ||
1374 | +static void | ||
1375 | remove_scroll_timeout (GtkTreeView *tree_view) | ||
1376 | { | ||
1377 | if (tree_view->priv->scroll_timeout != 0) | ||
1378 | @@ -6130,10 +6989,9 @@ | ||
1379 | tree_view->priv->open_dest_timeout = | ||
1380 | g_timeout_add (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view); | ||
1381 | } | ||
1382 | - else if (tree_view->priv->scroll_timeout == 0) | ||
1383 | + else | ||
1384 | { | ||
1385 | - tree_view->priv->scroll_timeout = | ||
1386 | - g_timeout_add (150, scroll_row_timeout, tree_view); | ||
1387 | + add_scroll_timeout (tree_view); | ||
1388 | } | ||
1389 | |||
1390 | if (target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE)) | ||
1391 | @@ -6901,8 +7759,6 @@ | ||
1392 | GtkMovementStep step, | ||
1393 | gint count) | ||
1394 | { | ||
1395 | - GdkModifierType state; | ||
1396 | - | ||
1397 | g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); | ||
1398 | g_return_val_if_fail (step == GTK_MOVEMENT_LOGICAL_POSITIONS || | ||
1399 | step == GTK_MOVEMENT_VISUAL_POSITIONS || | ||
1400 | @@ -6919,6 +7775,8 @@ | ||
1401 | GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS); | ||
1402 | gtk_widget_grab_focus (GTK_WIDGET (tree_view)); | ||
1403 | |||
1404 | + /* Hildon: Ignore ctrl and shift */ | ||
1405 | +#if 0 | ||
1406 | if (gtk_get_current_event_state (&state)) | ||
1407 | { | ||
1408 | if ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK) | ||
1409 | @@ -6926,6 +7784,7 @@ | ||
1410 | if ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) | ||
1411 | tree_view->priv->shift_pressed = TRUE; | ||
1412 | } | ||
1413 | +#endif | ||
1414 | /* else we assume not pressed */ | ||
1415 | |||
1416 | switch (step) | ||
1417 | @@ -7092,6 +7951,27 @@ | ||
1418 | done: | ||
1419 | if (!tree_view->priv->fixed_height_mode) | ||
1420 | install_presize_handler (tree_view); | ||
1421 | + | ||
1422 | + /* Hildon: has row now been dimmed? If so, unselect it */ | ||
1423 | + _gtk_tree_view_find_node (tree_view, path, &tree, &node); | ||
1424 | + if (!_gtk_tree_selection_is_row_selectable (tree_view->priv->selection, | ||
1425 | + node, | ||
1426 | + path)) | ||
1427 | + { | ||
1428 | + if (gtk_tree_path_compare (path, | ||
1429 | + gtk_tree_row_reference_get_path(tree_view->priv->cursor)) | ||
1430 | + == 0) | ||
1431 | + { | ||
1432 | + gtk_tree_row_reference_free (tree_view->priv->cursor); | ||
1433 | + tree_view->priv->cursor = NULL; | ||
1434 | + } | ||
1435 | + | ||
1436 | + gtk_tree_selection_unselect_path (tree_view->priv->selection, path); | ||
1437 | + gtk_tree_view_collapse_row (tree_view, path); | ||
1438 | + } | ||
1439 | + | ||
1440 | + check_if_can_focus (tree_view); | ||
1441 | + | ||
1442 | if (free_path) | ||
1443 | gtk_tree_path_free (path); | ||
1444 | } | ||
1445 | @@ -7196,6 +8076,11 @@ | ||
1446 | install_presize_handler (tree_view); | ||
1447 | if (free_path) | ||
1448 | gtk_tree_path_free (path); | ||
1449 | + | ||
1450 | + /* Hildon: after a focusable row has been added, the | ||
1451 | + entire widget becomes focusable if it wasn't before */ | ||
1452 | + if ((GTK_WIDGET_FLAGS (tree_view) & GTK_CAN_FOCUS) == 0) | ||
1453 | + check_if_can_focus (tree_view); | ||
1454 | } | ||
1455 | |||
1456 | static void | ||
1457 | @@ -7295,6 +8180,16 @@ | ||
1458 | _gtk_rbtree_traverse (node->children, node->children->root, G_POST_ORDER, check_selection_helper, data); | ||
1459 | } | ||
1460 | |||
1461 | +static gboolean | ||
1462 | +check_if_can_focus_idle (GtkTreeView *tree_view) | ||
1463 | +{ | ||
1464 | + check_if_can_focus (tree_view); | ||
1465 | + | ||
1466 | + tree_view->priv->check_if_can_focus_idle_id = 0; | ||
1467 | + | ||
1468 | + return FALSE; | ||
1469 | +} | ||
1470 | + | ||
1471 | static void | ||
1472 | gtk_tree_view_row_deleted (GtkTreeModel *model, | ||
1473 | GtkTreePath *path, | ||
1474 | @@ -7357,6 +8252,11 @@ | ||
1475 | tree_view->priv->tree = NULL; | ||
1476 | |||
1477 | _gtk_rbtree_remove (tree); | ||
1478 | + | ||
1479 | + /* Hildon: no nodes -> not focusable */ | ||
1480 | + /* FIXME this looks superfluos to me. check_if_can_focus is called | ||
1481 | + * at the end of this function .. -- Jorn */ | ||
1482 | + GTK_WIDGET_UNSET_FLAGS (tree_view, GTK_CAN_FOCUS); | ||
1483 | } | ||
1484 | else | ||
1485 | { | ||
1486 | @@ -7375,6 +8275,13 @@ | ||
1487 | |||
1488 | if (selection_changed) | ||
1489 | g_signal_emit_by_name (tree_view->priv->selection, "changed"); | ||
1490 | + | ||
1491 | + /* FIXME whacky hack to work around the treeview not being in a clean state | ||
1492 | + * when in a tree a row has been removed, but has_child_toggled not been | ||
1493 | + * called yet */ | ||
1494 | + if (tree_view->priv->check_if_can_focus_idle_id == 0) | ||
1495 | + tree_view->priv->check_if_can_focus_idle_id = | ||
1496 | + g_idle_add ((GSourceFunc) check_if_can_focus_idle, tree_view); | ||
1497 | } | ||
1498 | |||
1499 | static void | ||
1500 | @@ -7508,6 +8415,7 @@ | ||
1501 | GList *list; | ||
1502 | GtkTreeViewColumn *tmp_column = NULL; | ||
1503 | gint total_width; | ||
1504 | + gint expander_indent, depth; | ||
1505 | gboolean indent_expanders; | ||
1506 | gboolean rtl; | ||
1507 | |||
1508 | @@ -7535,14 +8443,19 @@ | ||
1509 | |||
1510 | gtk_widget_style_get (GTK_WIDGET (tree_view), | ||
1511 | "indent_expanders", &indent_expanders, | ||
1512 | + "expander_indent", &expander_indent, | ||
1513 | NULL); | ||
1514 | |||
1515 | + /* Hildonlike hack for making the indent look better. | ||
1516 | + * indent is added to all rows except the first one */ | ||
1517 | + depth = _gtk_rbtree_get_depth (tree); | ||
1518 | + | ||
1519 | if (indent_expanders) | ||
1520 | { | ||
1521 | if (rtl) | ||
1522 | - x_offset -= tree_view->priv->expander_size * _gtk_rbtree_get_depth (tree); | ||
1523 | + x_offset -= tree_view->priv->expander_size * depth + (depth) * expander_indent; | ||
1524 | else | ||
1525 | - x_offset += tree_view->priv->expander_size * _gtk_rbtree_get_depth (tree); | ||
1526 | + x_offset += tree_view->priv->expander_size * depth + (depth) * expander_indent; | ||
1527 | } | ||
1528 | if (x1) | ||
1529 | { | ||
1530 | @@ -7617,9 +8530,11 @@ | ||
1531 | gboolean retval = FALSE; | ||
1532 | gint tmpheight; | ||
1533 | gint horizontal_separator; | ||
1534 | + gint expander_indent; | ||
1535 | |||
1536 | gtk_widget_style_get (GTK_WIDGET (tree_view), | ||
1537 | "horizontal_separator", &horizontal_separator, | ||
1538 | + "expander_indent", &expander_indent, | ||
1539 | NULL); | ||
1540 | |||
1541 | if (height) | ||
1542 | @@ -7657,7 +8572,7 @@ | ||
1543 | if (gtk_tree_view_is_expander_column (tree_view, column) && | ||
1544 | TREE_VIEW_DRAW_EXPANDERS (tree_view)) | ||
1545 | { | ||
1546 | - if (depth * tree_view->priv->expander_size + horizontal_separator + width > column->requested_width) | ||
1547 | + if ((depth - 1) *expander_indent + depth * tree_view->priv->expander_size + horizontal_separator + width > column->requested_width) | ||
1548 | { | ||
1549 | _gtk_tree_view_column_cell_set_dirty (column, TRUE); | ||
1550 | retval = TRUE; | ||
1551 | @@ -7747,6 +8662,7 @@ | ||
1552 | } | ||
1553 | } | ||
1554 | |||
1555 | +#if 0 | ||
1556 | static void | ||
1557 | gtk_tree_view_clamp_column_visible (GtkTreeView *tree_view, | ||
1558 | GtkTreeViewColumn *column) | ||
1559 | @@ -7762,6 +8678,7 @@ | ||
1560 | gtk_adjustment_set_value (tree_view->priv->hadjustment, | ||
1561 | column->button->allocation.x); | ||
1562 | } | ||
1563 | +#endif | ||
1564 | |||
1565 | /* This function could be more efficient. I'll optimize it if profiling seems | ||
1566 | * to imply that it is important */ | ||
1567 | @@ -8290,7 +9207,7 @@ | ||
1568 | |||
1569 | area.x = x_offset; | ||
1570 | area.y = CELL_FIRST_PIXEL (tree_view, tree, node, vertical_separator); | ||
1571 | - area.width = expander_size + 2; | ||
1572 | + area.width = expander_size; | ||
1573 | area.height = MAX (CELL_HEIGHT (node, vertical_separator), (expander_size - vertical_separator)); | ||
1574 | |||
1575 | if (node == tree_view->priv->button_pressed_node) | ||
1576 | @@ -8397,7 +9314,10 @@ | ||
1577 | GtkRBNode *cursor_node = NULL; | ||
1578 | GtkRBTree *new_cursor_tree = NULL; | ||
1579 | GtkRBNode *new_cursor_node = NULL; | ||
1580 | + GtkRBTree *old_cursor_tree; | ||
1581 | + GtkRBNode *old_cursor_node; | ||
1582 | GtkTreePath *cursor_path = NULL; | ||
1583 | + GtkTreePath *new_cursor_path = NULL; | ||
1584 | |||
1585 | if (! GTK_WIDGET_HAS_FOCUS (tree_view)) | ||
1586 | return; | ||
1587 | @@ -8415,12 +9335,30 @@ | ||
1588 | if (cursor_tree == NULL) | ||
1589 | /* FIXME: we lost the cursor; should we get the first? */ | ||
1590 | return; | ||
1591 | - if (count == -1) | ||
1592 | - _gtk_rbtree_prev_full (cursor_tree, cursor_node, | ||
1593 | - &new_cursor_tree, &new_cursor_node); | ||
1594 | - else | ||
1595 | - _gtk_rbtree_next_full (cursor_tree, cursor_node, | ||
1596 | - &new_cursor_tree, &new_cursor_node); | ||
1597 | + | ||
1598 | + old_cursor_tree = cursor_tree; | ||
1599 | + old_cursor_node = cursor_node; | ||
1600 | + do { | ||
1601 | + if (count == -1) | ||
1602 | + _gtk_rbtree_prev_full (old_cursor_tree, old_cursor_node, | ||
1603 | + &new_cursor_tree, &new_cursor_node); | ||
1604 | + else | ||
1605 | + _gtk_rbtree_next_full (old_cursor_tree, old_cursor_node, | ||
1606 | + &new_cursor_tree, &new_cursor_node); | ||
1607 | + | ||
1608 | + if (new_cursor_node) | ||
1609 | + { | ||
1610 | + if (new_cursor_path) | ||
1611 | + gtk_tree_path_free (new_cursor_path); | ||
1612 | + | ||
1613 | + new_cursor_path = _gtk_tree_view_find_path (tree_view, new_cursor_tree, new_cursor_node); | ||
1614 | + old_cursor_tree = new_cursor_tree; | ||
1615 | + old_cursor_node = new_cursor_node; | ||
1616 | + } | ||
1617 | + } while (new_cursor_node && | ||
1618 | + !_gtk_tree_selection_is_row_selectable (tree_view->priv->selection, | ||
1619 | + new_cursor_node, | ||
1620 | + new_cursor_path)); | ||
1621 | |||
1622 | /* | ||
1623 | * If the list has only one item and multi-selection is set then select | ||
1624 | @@ -8450,7 +9388,33 @@ | ||
1625 | if (new_cursor_node) | ||
1626 | { | ||
1627 | cursor_path = _gtk_tree_view_find_path (tree_view, new_cursor_tree, new_cursor_node); | ||
1628 | - gtk_tree_view_real_set_cursor (tree_view, cursor_path, TRUE, TRUE); | ||
1629 | + | ||
1630 | + if (tree_view->priv->checkbox_mode) | ||
1631 | + gtk_tree_view_real_set_cursor (tree_view, cursor_path, FALSE, TRUE); | ||
1632 | + else | ||
1633 | + gtk_tree_view_real_set_cursor (tree_view, cursor_path, TRUE, TRUE); | ||
1634 | + | ||
1635 | + if (tree_view->priv->pen_drag_active) | ||
1636 | + { | ||
1637 | + if (gtk_tree_path_compare (gtk_tree_row_reference_get_path (tree_view->priv->last_drag_row), | ||
1638 | + gtk_tree_row_reference_get_path (tree_view->priv->first_drag_row)) == 0) | ||
1639 | + tree_view->priv->pen_drag_reverse = FALSE; | ||
1640 | + | ||
1641 | + if (tree_view->priv->pen_drag_reverse) | ||
1642 | + { | ||
1643 | + gtk_tree_selection_select_path (tree_view->priv->selection, | ||
1644 | + cursor_path); | ||
1645 | + gtk_tree_selection_unselect_path (tree_view->priv->selection, | ||
1646 | + gtk_tree_row_reference_get_path (tree_view->priv->last_drag_row)); | ||
1647 | + } | ||
1648 | + | ||
1649 | + gtk_tree_row_reference_free (tree_view->priv->last_drag_row); | ||
1650 | + | ||
1651 | + tree_view->priv->last_drag_row = | ||
1652 | + gtk_tree_row_reference_new (tree_view->priv->model, | ||
1653 | + cursor_path); | ||
1654 | + } | ||
1655 | + | ||
1656 | gtk_tree_path_free (cursor_path); | ||
1657 | } | ||
1658 | else | ||
1659 | @@ -8467,6 +9431,8 @@ | ||
1660 | { | ||
1661 | GtkRBTree *cursor_tree = NULL; | ||
1662 | GtkRBNode *cursor_node = NULL; | ||
1663 | + GtkRBTree *old_cursor_tree = NULL; | ||
1664 | + GtkRBNode *old_cursor_node = NULL; | ||
1665 | GtkTreePath *cursor_path = NULL; | ||
1666 | gint y; | ||
1667 | gint vertical_separator; | ||
1668 | @@ -8474,6 +9440,9 @@ | ||
1669 | if (! GTK_WIDGET_HAS_FOCUS (tree_view)) | ||
1670 | return; | ||
1671 | |||
1672 | + if (tree_view->priv->tree == NULL) | ||
1673 | + return; | ||
1674 | + | ||
1675 | if (gtk_tree_row_reference_valid (tree_view->priv->cursor)) | ||
1676 | cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor); | ||
1677 | else | ||
1678 | @@ -8504,7 +9473,65 @@ | ||
1679 | |||
1680 | _gtk_rbtree_find_offset (tree_view->priv->tree, y, &cursor_tree, &cursor_node); | ||
1681 | cursor_path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node); | ||
1682 | - g_return_if_fail (cursor_path != NULL); | ||
1683 | + | ||
1684 | + while (cursor_node && | ||
1685 | + !_gtk_tree_selection_is_row_selectable (tree_view->priv->selection, | ||
1686 | + cursor_node, | ||
1687 | + cursor_path)) | ||
1688 | + { | ||
1689 | + old_cursor_tree = cursor_tree; | ||
1690 | + old_cursor_node = cursor_node; | ||
1691 | + | ||
1692 | + if (count < 0) | ||
1693 | + _gtk_rbtree_prev_full (old_cursor_tree, old_cursor_node, | ||
1694 | + &cursor_tree, &cursor_node); | ||
1695 | + else | ||
1696 | + _gtk_rbtree_next_full (old_cursor_tree, old_cursor_node, | ||
1697 | + &cursor_tree, &cursor_node); | ||
1698 | + | ||
1699 | + if (cursor_path) | ||
1700 | + { | ||
1701 | + gtk_tree_path_free(cursor_path); | ||
1702 | + cursor_path = NULL; | ||
1703 | + } | ||
1704 | + | ||
1705 | + if (cursor_node) | ||
1706 | + cursor_path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node); | ||
1707 | + } | ||
1708 | + | ||
1709 | + if (cursor_path == NULL) | ||
1710 | + { | ||
1711 | + /* looks like we reached the end without finding a sensitive row, | ||
1712 | + so search backwards and try to find the last sensitive row as | ||
1713 | + the next best thing */ | ||
1714 | + _gtk_rbtree_find_offset (tree_view->priv->tree, y, &cursor_tree, &cursor_node); | ||
1715 | + cursor_path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node); | ||
1716 | + while (cursor_node && | ||
1717 | + !_gtk_tree_selection_is_row_selectable (tree_view->priv->selection, | ||
1718 | + cursor_node, | ||
1719 | + cursor_path)) | ||
1720 | + { | ||
1721 | + old_cursor_tree = cursor_tree; | ||
1722 | + old_cursor_node = cursor_node; | ||
1723 | + | ||
1724 | + if (count < 0) | ||
1725 | + _gtk_rbtree_next_full (old_cursor_tree, old_cursor_node, | ||
1726 | + &cursor_tree, &cursor_node); | ||
1727 | + else | ||
1728 | + _gtk_rbtree_prev_full (old_cursor_tree, old_cursor_node, | ||
1729 | + &cursor_tree, &cursor_node); | ||
1730 | + | ||
1731 | + if (cursor_path) | ||
1732 | + { | ||
1733 | + gtk_tree_path_free(cursor_path); | ||
1734 | + cursor_path = NULL; | ||
1735 | + } | ||
1736 | + | ||
1737 | + if (cursor_node) | ||
1738 | + cursor_path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node); | ||
1739 | + } | ||
1740 | + } | ||
1741 | + | ||
1742 | gtk_tree_view_real_set_cursor (tree_view, cursor_path, TRUE, TRUE); | ||
1743 | gtk_tree_view_clamp_node_visible (tree_view, cursor_tree, cursor_node); | ||
1744 | gtk_tree_path_free (cursor_path); | ||
1745 | @@ -8514,6 +9541,8 @@ | ||
1746 | gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view, | ||
1747 | gint count) | ||
1748 | { | ||
1749 | + /* Hildon: cursor is always displayed on an entire row anyway */ | ||
1750 | +#if 0 | ||
1751 | GtkRBTree *cursor_tree = NULL; | ||
1752 | GtkRBNode *cursor_node = NULL; | ||
1753 | GtkTreePath *cursor_path = NULL; | ||
1754 | @@ -8589,12 +9618,15 @@ | ||
1755 | g_signal_emit (tree_view, tree_view_signals[CURSOR_CHANGED], 0); | ||
1756 | } | ||
1757 | gtk_tree_view_clamp_column_visible (tree_view, tree_view->priv->focus_column); | ||
1758 | +#endif | ||
1759 | } | ||
1760 | |||
1761 | static void | ||
1762 | gtk_tree_view_move_cursor_start_end (GtkTreeView *tree_view, | ||
1763 | gint count) | ||
1764 | { | ||
1765 | + /* Hildon: cursor is always displayed on an entire row anyway */ | ||
1766 | +#if 0 | ||
1767 | GtkRBTree *cursor_tree; | ||
1768 | GtkRBNode *cursor_node; | ||
1769 | GtkTreePath *path; | ||
1770 | @@ -8631,6 +9663,7 @@ | ||
1771 | path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node); | ||
1772 | gtk_tree_view_real_set_cursor (tree_view, path, TRUE, TRUE); | ||
1773 | gtk_tree_path_free (path); | ||
1774 | +#endif | ||
1775 | } | ||
1776 | |||
1777 | static gboolean | ||
1778 | @@ -8670,7 +9703,7 @@ | ||
1779 | GtkTreePath *cursor_path = NULL; | ||
1780 | GtkTreeSelectMode mode = 0; | ||
1781 | |||
1782 | - if (! GTK_WIDGET_HAS_FOCUS (tree_view)) | ||
1783 | + if (! GTK_WIDGET_HAS_FOCUS (tree_view) && !tree_view->priv->checkbox_mode) | ||
1784 | return FALSE; | ||
1785 | |||
1786 | if (tree_view->priv->cursor) | ||
1787 | @@ -8731,7 +9764,7 @@ | ||
1788 | GtkRBNode *cursor_node = NULL; | ||
1789 | GtkTreePath *cursor_path = NULL; | ||
1790 | |||
1791 | - if (! GTK_WIDGET_HAS_FOCUS (tree_view)) | ||
1792 | + if (! GTK_WIDGET_HAS_FOCUS (tree_view) && !tree_view->priv->checkbox_mode) | ||
1793 | return FALSE; | ||
1794 | |||
1795 | cursor_path = NULL; | ||
1796 | @@ -8774,6 +9807,7 @@ | ||
1797 | GtkTreePath *cursor_path = NULL; | ||
1798 | GtkRBTree *tree; | ||
1799 | GtkRBNode *node; | ||
1800 | + gboolean hildon_row; | ||
1801 | |||
1802 | if (! GTK_WIDGET_HAS_FOCUS (tree_view)) | ||
1803 | return FALSE; | ||
1804 | @@ -8796,10 +9830,32 @@ | ||
1805 | && gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL) | ||
1806 | expand = !expand; | ||
1807 | |||
1808 | - if (expand) | ||
1809 | - gtk_tree_view_real_expand_row (tree_view, cursor_path, tree, node, open_all, TRUE); | ||
1810 | + /* Keyboard Navigation: if we can't expand/collapse row, we should either move active focus | ||
1811 | + to child item (right arrow) or move active focus to the parent item (left arrow) */ | ||
1812 | + if (expand) | ||
1813 | + { | ||
1814 | + hildon_row = gtk_tree_view_real_expand_row (tree_view, cursor_path, tree, | ||
1815 | + node, open_all, TRUE); | ||
1816 | + | ||
1817 | + if (!hildon_row || !node->children) | ||
1818 | + g_signal_emit_by_name (gtk_widget_get_ancestor (GTK_WIDGET (tree_view), | ||
1819 | + GTK_TYPE_WINDOW), | ||
1820 | + "move_focus", | ||
1821 | + GTK_DIR_TAB_FORWARD); | ||
1822 | + } | ||
1823 | else | ||
1824 | - gtk_tree_view_real_collapse_row (tree_view, cursor_path, tree, node, TRUE); | ||
1825 | + { | ||
1826 | + hildon_row = gtk_tree_view_real_collapse_row (tree_view, cursor_path, tree, node, TRUE); | ||
1827 | + | ||
1828 | + if (hildon_row == FALSE) | ||
1829 | + { | ||
1830 | + g_signal_emit_by_name (gtk_widget_get_ancestor (GTK_WIDGET(tree_view), | ||
1831 | + GTK_TYPE_WINDOW), | ||
1832 | + "move_focus", | ||
1833 | + GTK_DIR_TAB_BACKWARD); | ||
1834 | + gtk_tree_view_real_select_cursor_parent (tree_view); | ||
1835 | + } | ||
1836 | + } | ||
1837 | |||
1838 | gtk_tree_path_free (cursor_path); | ||
1839 | |||
1840 | @@ -9327,6 +10383,14 @@ | ||
1841 | tree_view->priv->last_button_press_2 = NULL; | ||
1842 | gtk_tree_row_reference_free (tree_view->priv->scroll_to_path); | ||
1843 | tree_view->priv->scroll_to_path = NULL; | ||
1844 | + gtk_tree_row_reference_free (tree_view->priv->first_drag_row); | ||
1845 | + tree_view->priv->first_drag_row = NULL; | ||
1846 | + gtk_tree_row_reference_free (tree_view->priv->last_drag_row); | ||
1847 | + tree_view->priv->last_drag_row = NULL; | ||
1848 | + gtk_tree_row_reference_free (tree_view->priv->queued_expand_row); | ||
1849 | + tree_view->priv->queued_expand_row = NULL; | ||
1850 | + gtk_tree_row_reference_free (tree_view->priv->queued_select_row); | ||
1851 | + tree_view->priv->queued_select_row = NULL; | ||
1852 | |||
1853 | tree_view->priv->scroll_to_column = NULL; | ||
1854 | |||
1855 | @@ -9402,6 +10466,8 @@ | ||
1856 | install_presize_handler (tree_view); | ||
1857 | } | ||
1858 | |||
1859 | + check_if_can_focus (tree_view); | ||
1860 | + | ||
1861 | g_object_notify (G_OBJECT (tree_view), "model"); | ||
1862 | |||
1863 | if (GTK_WIDGET_REALIZED (tree_view)) | ||
1864 | @@ -9744,6 +10810,10 @@ | ||
1865 | G_CALLBACK (column_sizing_notify), | ||
1866 | tree_view); | ||
1867 | |||
1868 | + g_signal_handlers_disconnect_by_func (column, | ||
1869 | + G_CALLBACK (update_checkbox_mode), | ||
1870 | + tree_view); | ||
1871 | + | ||
1872 | _gtk_tree_view_column_unset_tree_view (column); | ||
1873 | |||
1874 | tree_view->priv->columns = g_list_remove (tree_view->priv->columns, column); | ||
1875 | @@ -9773,6 +10843,8 @@ | ||
1876 | g_object_unref (column); | ||
1877 | g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); | ||
1878 | |||
1879 | + update_checkbox_mode (NULL, NULL, tree_view); | ||
1880 | + | ||
1881 | return tree_view->priv->n_columns; | ||
1882 | } | ||
1883 | |||
1884 | @@ -9815,6 +10887,9 @@ | ||
1885 | g_signal_connect (column, "notify::sizing", | ||
1886 | G_CALLBACK (column_sizing_notify), tree_view); | ||
1887 | |||
1888 | + g_signal_connect (column, "notify::visible", | ||
1889 | + G_CALLBACK (update_checkbox_mode), tree_view); | ||
1890 | + | ||
1891 | tree_view->priv->columns = g_list_insert (tree_view->priv->columns, | ||
1892 | column, position); | ||
1893 | tree_view->priv->n_columns++; | ||
1894 | @@ -9838,6 +10913,9 @@ | ||
1895 | |||
1896 | g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); | ||
1897 | |||
1898 | + update_checkbox_mode (NULL, NULL, tree_view); | ||
1899 | + check_if_can_focus (tree_view); | ||
1900 | + | ||
1901 | return tree_view->priv->n_columns; | ||
1902 | } | ||
1903 | |||
1904 | @@ -10295,7 +11373,6 @@ | ||
1905 | GtkTreeViewColumn *column) | ||
1906 | { | ||
1907 | g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); | ||
1908 | - | ||
1909 | g_signal_emit (tree_view, tree_view_signals[ROW_ACTIVATED], 0, path, column); | ||
1910 | } | ||
1911 | |||
1912 | @@ -10560,6 +11637,16 @@ | ||
1913 | GtkTreeIter iter; | ||
1914 | GtkTreeIter temp; | ||
1915 | gboolean expand; | ||
1916 | + gint vertical_separator; | ||
1917 | + GtkTreePath *collapse_path; | ||
1918 | + GtkRBTree *tree2; | ||
1919 | + GtkRBNode *node2; | ||
1920 | + GtkTreePath *child_path = NULL; | ||
1921 | + GtkTreeIter parent_iter; | ||
1922 | + GtkTreeIter child_iter; | ||
1923 | + GdkRectangle visible_rect; | ||
1924 | + gint children, n; | ||
1925 | + guint total_height; | ||
1926 | |||
1927 | remove_auto_expand_timeout (tree_view); | ||
1928 | |||
1929 | @@ -10573,8 +11660,12 @@ | ||
1930 | if (! gtk_tree_model_iter_has_child (tree_view->priv->model, &iter)) | ||
1931 | return FALSE; | ||
1932 | |||
1933 | + /* Hildon: insensitive rows cannot be expanded */ | ||
1934 | + if (!_gtk_tree_selection_is_row_selectable (tree_view->priv->selection, | ||
1935 | + node, path)) | ||
1936 | + return FALSE; | ||
1937 | |||
1938 | - if (node->children && open_all) | ||
1939 | + if (node->children && open_all) | ||
1940 | { | ||
1941 | gboolean retval = FALSE; | ||
1942 | GtkTreePath *tmp_path = gtk_tree_path_copy (path); | ||
1943 | @@ -10603,6 +11694,37 @@ | ||
1944 | return retval; | ||
1945 | } | ||
1946 | |||
1947 | + /* Hildon: collapse other items in the same level */ | ||
1948 | + gtk_widget_style_get (GTK_WIDGET (tree_view), | ||
1949 | + "vertical_separator", &vertical_separator, NULL); | ||
1950 | + | ||
1951 | + /* find the first child */ | ||
1952 | + collapse_path = gtk_tree_path_copy (path); | ||
1953 | + while (gtk_tree_path_prev (collapse_path)) | ||
1954 | + ; | ||
1955 | + | ||
1956 | + do { | ||
1957 | + if (gtk_tree_path_compare (collapse_path, path) != 0) | ||
1958 | + { | ||
1959 | + _gtk_tree_view_find_node (tree_view, collapse_path, &tree2, &node2); | ||
1960 | + | ||
1961 | + if (tree2 == NULL) | ||
1962 | + /* end reached already */ | ||
1963 | + break; | ||
1964 | + | ||
1965 | + if (node2->children != NULL && | ||
1966 | + gtk_tree_view_real_collapse_row (tree_view, collapse_path, | ||
1967 | + tree2, node2, FALSE)) | ||
1968 | + /* no need to do anything else since only one row may | ||
1969 | + be expanded on any particular level at any time */ | ||
1970 | + break; | ||
1971 | + } | ||
1972 | + | ||
1973 | + gtk_tree_path_next (collapse_path); | ||
1974 | + } while (1); | ||
1975 | + | ||
1976 | + gtk_tree_path_free (collapse_path); | ||
1977 | + | ||
1978 | g_signal_emit (tree_view, tree_view_signals[TEST_EXPAND_ROW], 0, &iter, path, &expand); | ||
1979 | |||
1980 | if (expand) | ||
1981 | @@ -10643,6 +11765,42 @@ | ||
1982 | GTK_RBNODE_SET_FLAG (node, GTK_RBNODE_IS_SEMI_COLLAPSED); | ||
1983 | } | ||
1984 | |||
1985 | + /* autoscroll if necessary */ | ||
1986 | + validate_visible_area (tree_view); | ||
1987 | + gtk_tree_model_get_iter (tree_view->priv->model, &parent_iter, path); | ||
1988 | + _gtk_tree_view_find_node (tree_view, path, &tree2, &node2); | ||
1989 | + validate_row (tree_view, tree2, node2, &parent_iter, path); | ||
1990 | + total_height = CELL_HEIGHT (node2, vertical_separator); | ||
1991 | + children = gtk_tree_model_iter_n_children (tree_view->priv->model, &parent_iter); | ||
1992 | + for (n = 0; n < children; n++) | ||
1993 | + { | ||
1994 | + gtk_tree_model_iter_nth_child (tree_view->priv->model, | ||
1995 | + &child_iter, &parent_iter, n); | ||
1996 | + | ||
1997 | + /* must free here so the path of last child is kept for later */ | ||
1998 | + if (child_path != NULL) | ||
1999 | + gtk_tree_path_free (child_path); | ||
2000 | + | ||
2001 | + child_path = gtk_tree_model_get_path (tree_view->priv->model, &child_iter); | ||
2002 | + _gtk_tree_view_find_node (tree_view, child_path, &tree2, &node2); | ||
2003 | + | ||
2004 | + if (CELL_HEIGHT (node2, 0) == 0) | ||
2005 | + validate_row (tree_view, tree2, node2, &child_iter, child_path); | ||
2006 | + | ||
2007 | + total_height += CELL_HEIGHT (node2, vertical_separator); | ||
2008 | + } | ||
2009 | + | ||
2010 | + gtk_tree_view_get_visible_rect (tree_view, &visible_rect); | ||
2011 | + | ||
2012 | + /* KNOWN BUG: If no autocollapse was performed earlier above, these calls | ||
2013 | + to gtk_tree_view_scroll_to_cell do nothing although they should. */ | ||
2014 | + if (total_height > visible_rect.height) | ||
2015 | + gtk_tree_view_scroll_to_cell (tree_view, path, NULL, TRUE, 0.0, 0.0); | ||
2016 | + else | ||
2017 | + gtk_tree_view_scroll_to_cell (tree_view, child_path, NULL, FALSE, 0.0, 0.0); | ||
2018 | + | ||
2019 | + gtk_tree_path_free (child_path); | ||
2020 | + | ||
2021 | install_presize_handler (tree_view); | ||
2022 | |||
2023 | g_signal_emit (tree_view, tree_view_signals[ROW_EXPANDED], 0, &iter, path); | ||
2024 | @@ -11070,6 +12228,16 @@ | ||
2025 | GtkRBTree *tree = NULL; | ||
2026 | GtkRBNode *node = NULL; | ||
2027 | |||
2028 | + _gtk_tree_view_find_node (tree_view, path, &tree, &node); | ||
2029 | + | ||
2030 | + /* Hildon: cursor cannot move to an insensitive row */ | ||
2031 | + if (!_gtk_tree_selection_is_row_selectable (tree_view->priv->selection, | ||
2032 | + node, path)) | ||
2033 | + { | ||
2034 | + g_signal_emit (tree_view, tree_view_signals[ROW_INSENSITIVE], 0, path); | ||
2035 | + return; | ||
2036 | + } | ||
2037 | + | ||
2038 | if (gtk_tree_row_reference_valid (tree_view->priv->cursor)) | ||
2039 | { | ||
2040 | GtkTreePath *cursor_path; | ||
2041 | @@ -11083,7 +12251,6 @@ | ||
2042 | tree_view->priv->cursor = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), | ||
2043 | tree_view->priv->model, | ||
2044 | path); | ||
2045 | - _gtk_tree_view_find_node (tree_view, path, &tree, &node); | ||
2046 | if (tree != NULL) | ||
2047 | { | ||
2048 | GtkRBTree *new_tree = NULL; | ||
2049 | @@ -11093,7 +12260,8 @@ | ||
2050 | { | ||
2051 | GtkTreeSelectMode mode = 0; | ||
2052 | |||
2053 | - if (tree_view->priv->ctrl_pressed) | ||
2054 | + if (tree_view->priv->ctrl_pressed || | ||
2055 | + tree_view->priv->pen_drag_active) | ||
2056 | mode |= GTK_TREE_SELECT_MODE_TOGGLE; | ||
2057 | if (tree_view->priv->shift_pressed) | ||
2058 | mode |= GTK_TREE_SELECT_MODE_EXTEND; | ||
2059 | @@ -11213,6 +12381,9 @@ | ||
2060 | { | ||
2061 | g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); | ||
2062 | g_return_if_fail (path != NULL); | ||
2063 | + | ||
2064 | + tree_view->priv->pen_focus = FALSE; | ||
2065 | + | ||
2066 | if (focus_column) | ||
2067 | g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (focus_column)); | ||
2068 | if (focus_cell) | ||
2069 | @@ -11414,6 +12585,7 @@ | ||
2070 | GtkRBNode *node = NULL; | ||
2071 | gint vertical_separator; | ||
2072 | gint horizontal_separator; | ||
2073 | + gint expander_indent; | ||
2074 | |||
2075 | g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); | ||
2076 | g_return_if_fail (column == NULL || GTK_IS_TREE_VIEW_COLUMN (column)); | ||
2077 | @@ -11424,6 +12596,7 @@ | ||
2078 | gtk_widget_style_get (GTK_WIDGET (tree_view), | ||
2079 | "vertical_separator", &vertical_separator, | ||
2080 | "horizontal_separator", &horizontal_separator, | ||
2081 | + "expander_indent", &expander_indent, | ||
2082 | NULL); | ||
2083 | |||
2084 | rect->x = 0; | ||
2085 | @@ -11453,9 +12626,11 @@ | ||
2086 | TREE_VIEW_DRAW_EXPANDERS (tree_view)) | ||
2087 | { | ||
2088 | gint depth = gtk_tree_path_get_depth (path) - 1; | ||
2089 | + gint adjust; | ||
2090 | |||
2091 | - rect->x += depth * tree_view->priv->expander_size; | ||
2092 | - rect->width -= depth * tree_view->priv->expander_size; | ||
2093 | + adjust = depth * tree_view->priv->expander_size + (depth - 1) * expander_indent; | ||
2094 | + rect->x += adjust; | ||
2095 | + rect->width -= adjust; | ||
2096 | rect->width = MAX (rect->width, 0); | ||
2097 | } | ||
2098 | } | ||
2099 | @@ -12077,8 +13252,13 @@ | ||
2100 | if (gtk_tree_view_is_expander_column (tree_view, column) && | ||
2101 | TREE_VIEW_DRAW_EXPANDERS(tree_view)) | ||
2102 | { | ||
2103 | - cell_area.x += depth * tree_view->priv->expander_size; | ||
2104 | - cell_area.width -= depth * tree_view->priv->expander_size; | ||
2105 | + gint adjust, expander_indent; | ||
2106 | + | ||
2107 | + gtk_widget_style_get (widget, "expander_indent", &expander_indent, NULL); | ||
2108 | + | ||
2109 | + adjust = depth * tree_view->priv->expander_size + (depth - 1) * expander_indent; | ||
2110 | + cell_area.x += adjust; | ||
2111 | + cell_area.width -= adjust; | ||
2112 | } | ||
2113 | |||
2114 | if (gtk_tree_view_column_cell_is_visible (column)) | ||
2115 | @@ -13062,3 +14242,138 @@ | ||
2116 | tree_view->priv->pressed_button = -1; | ||
2117 | } | ||
2118 | |||
2119 | +/* Hildon addition: iterates through columns and cells, looks for | ||
2120 | + a cell with "activatable" attribute and sets or unsets | ||
2121 | + priv->checkbox_mode accordingly (except when checkbox mode | ||
2122 | + is disabled by unsetting allow_checkbox_mode). | ||
2123 | + */ | ||
2124 | +static void | ||
2125 | +update_checkbox_mode (GObject *object, GParamSpec *pspec, gpointer data) | ||
2126 | +{ | ||
2127 | + GtkTreeView *tree_view = GTK_TREE_VIEW (data); | ||
2128 | + GList *columns = gtk_tree_view_get_columns (tree_view); | ||
2129 | + GList *list; | ||
2130 | + gboolean allow_checkbox_mode; | ||
2131 | + | ||
2132 | + g_object_get (GTK_WIDGET (data), | ||
2133 | + "allow_checkbox_mode", &allow_checkbox_mode, NULL); | ||
2134 | + g_return_if_fail (allow_checkbox_mode); | ||
2135 | + | ||
2136 | + for (list = columns; list; list = list->next) | ||
2137 | + { | ||
2138 | + GtkTreeViewColumn *col = GTK_TREE_VIEW_COLUMN (list->data); | ||
2139 | + if (gtk_tree_view_column_get_visible (col) && | ||
2140 | + _gtk_tree_view_column_has_activatable_cell (col)) | ||
2141 | + { | ||
2142 | + /* checkbox column found */ | ||
2143 | + tree_view->priv->checkbox_mode = TRUE; | ||
2144 | + g_list_free (columns); | ||
2145 | + return; | ||
2146 | + } | ||
2147 | + } | ||
2148 | + | ||
2149 | + /* no checkbox column was found */ | ||
2150 | + tree_view->priv->checkbox_mode = FALSE; | ||
2151 | + g_list_free (columns); | ||
2152 | +} | ||
2153 | + | ||
2154 | +static void | ||
2155 | +set_dotted_lines (GtkTreeView *tree_view, gboolean enable) | ||
2156 | +{ | ||
2157 | + if (enable != tree_view->priv->dotted_lines) | ||
2158 | + { | ||
2159 | + tree_view->priv->dotted_lines = enable; | ||
2160 | + gtk_widget_queue_draw (GTK_WIDGET (tree_view)); | ||
2161 | + } | ||
2162 | +} | ||
2163 | + | ||
2164 | +/* This function is used to ensure two things: | ||
2165 | + * - in single selection mode, focus will always equal selection | ||
2166 | + * - in multiple selection mode, focus is removed if cursor row is | ||
2167 | + * explicitly unselected | ||
2168 | + */ | ||
2169 | +static void | ||
2170 | +selection_changed (GtkTreeSelection *selection, gpointer data) | ||
2171 | +{ | ||
2172 | + GtkTreeView *tree_view = GTK_TREE_VIEW(data); | ||
2173 | + GtkTreePath *cursor_path = NULL; | ||
2174 | + GtkTreeIter iter; | ||
2175 | + | ||
2176 | + /* if there are checkboxes, cursor row doesn't have to be selected */ | ||
2177 | + if (tree_view->priv->checkbox_mode) | ||
2178 | + return; | ||
2179 | + | ||
2180 | + if (gtk_tree_row_reference_valid (tree_view->priv->cursor)) | ||
2181 | + cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor); | ||
2182 | + | ||
2183 | + if (cursor_path == NULL || | ||
2184 | + !gtk_tree_selection_path_is_selected (selection, cursor_path)) | ||
2185 | + { | ||
2186 | + GtkTreePath *selected_path; | ||
2187 | + GtkRBTree *tree = NULL; | ||
2188 | + GtkRBNode *node = NULL; | ||
2189 | + | ||
2190 | + if (gtk_tree_selection_get_mode (selection) != GTK_SELECTION_MULTIPLE && | ||
2191 | + gtk_tree_selection_get_selected (selection, NULL, &iter)) | ||
2192 | + { | ||
2193 | + selected_path = gtk_tree_model_get_path (tree_view->priv->model, | ||
2194 | + &iter); | ||
2195 | + gtk_tree_view_real_set_cursor (tree_view, selected_path, TRUE, TRUE); | ||
2196 | + _gtk_tree_view_find_node (tree_view, selected_path, &tree, &node); | ||
2197 | + gtk_tree_view_clamp_node_visible (tree_view, tree, node); | ||
2198 | + gtk_tree_path_free (selected_path); | ||
2199 | + gtk_widget_grab_focus (GTK_WIDGET (tree_view)); | ||
2200 | + } | ||
2201 | + else | ||
2202 | + { | ||
2203 | + gtk_tree_row_reference_free (tree_view->priv->cursor); | ||
2204 | + tree_view->priv->cursor = NULL; | ||
2205 | + } | ||
2206 | + } | ||
2207 | + | ||
2208 | + if (cursor_path) | ||
2209 | + gtk_tree_path_free (cursor_path); | ||
2210 | +} | ||
2211 | + | ||
2212 | +/* Helper function for ensuring that GtkTreeView is focusable | ||
2213 | + * if and only if it contains at least one sensitive top-level row. | ||
2214 | + * Should be called whenever the existence of a sensitive top-level row | ||
2215 | + * might have changed. | ||
2216 | + */ | ||
2217 | +static void | ||
2218 | +check_if_can_focus (GtkTreeView *tree_view) | ||
2219 | +{ | ||
2220 | + GtkTreeModel *model = gtk_tree_view_get_model (tree_view); | ||
2221 | + GtkTreeIter iter; | ||
2222 | + | ||
2223 | + if (model == NULL || !GTK_WIDGET_MAPPED (tree_view)) | ||
2224 | + return; | ||
2225 | + | ||
2226 | + if (gtk_tree_model_get_iter_first (model, &iter) == FALSE) | ||
2227 | + { | ||
2228 | + GTK_WIDGET_UNSET_FLAGS (tree_view, GTK_CAN_FOCUS); | ||
2229 | + return; | ||
2230 | + } | ||
2231 | + | ||
2232 | + do { | ||
2233 | + GtkTreePath *path = gtk_tree_model_get_path (model, &iter); | ||
2234 | + GtkRBTree *tree; | ||
2235 | + GtkRBNode *node; | ||
2236 | + | ||
2237 | + _gtk_tree_view_find_node (tree_view, path, &tree, &node); | ||
2238 | + | ||
2239 | + if (_gtk_tree_selection_is_row_selectable (tree_view->priv->selection, | ||
2240 | + node, path)) | ||
2241 | + { | ||
2242 | + GTK_WIDGET_SET_FLAGS (tree_view, GTK_CAN_FOCUS); | ||
2243 | + if (!gtk_tree_row_reference_valid (tree_view->priv->cursor)) | ||
2244 | + gtk_tree_view_real_set_cursor (tree_view, path, | ||
2245 | + !tree_view->priv->checkbox_mode, | ||
2246 | + TRUE); | ||
2247 | + | ||
2248 | + return; | ||
2249 | + } | ||
2250 | + } while (gtk_tree_model_iter_next (model, &iter)); | ||
2251 | + | ||
2252 | + GTK_WIDGET_UNSET_FLAGS (tree_view, GTK_CAN_FOCUS); | ||
2253 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeview.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeview.h.diff deleted file mode 100644 index 13f5c75600..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeview.h.diff +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktreeview.h 2004-11-23 22:02:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktreeview.h 2005-04-06 16:19:38.342709384 +0300 | ||
3 | @@ -102,12 +102,14 @@ | ||
4 | gboolean (* select_cursor_parent) (GtkTreeView *tree_view); | ||
5 | gboolean (* start_interactive_search) (GtkTreeView *tree_view); | ||
6 | |||
7 | + void (* row_insensitive) (GtkTreeView *tree_view, | ||
8 | + GtkTreePath *path); | ||
9 | + | ||
10 | /* Padding for future expansion */ | ||
11 | void (*_gtk_reserved0) (void); | ||
12 | void (*_gtk_reserved1) (void); | ||
13 | void (*_gtk_reserved2) (void); | ||
14 | void (*_gtk_reserved3) (void); | ||
15 | - void (*_gtk_reserved4) (void); | ||
16 | }; | ||
17 | |||
18 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeviewcolumn.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeviewcolumn.c.diff deleted file mode 100644 index aab0f0ed1f..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeviewcolumn.c.diff +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktreeviewcolumn.c 2005-01-05 00:10:56.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktreeviewcolumn.c 2005-04-06 16:19:38.346708776 +0300 | ||
3 | @@ -1367,6 +1367,19 @@ | ||
4 | return FALSE; | ||
5 | } | ||
6 | |||
7 | +gboolean | ||
8 | +_gtk_tree_view_column_has_activatable_cell (GtkTreeViewColumn *column) | ||
9 | +{ | ||
10 | + GList *list; | ||
11 | + | ||
12 | + for (list = column->cell_list; list; list = list->next) | ||
13 | + if (((GtkTreeViewColumnCellInfo *)list->data)->cell->mode == | ||
14 | + GTK_CELL_RENDERER_MODE_ACTIVATABLE) | ||
15 | + return TRUE; | ||
16 | + | ||
17 | + return FALSE; | ||
18 | +} | ||
19 | + | ||
20 | /* gets cell being edited */ | ||
21 | GtkCellRenderer * | ||
22 | _gtk_tree_view_column_get_edited_cell (GtkTreeViewColumn *column) | ||
23 | @@ -2582,6 +2595,7 @@ | ||
24 | GList *list; | ||
25 | gboolean first_cell = TRUE; | ||
26 | gint focus_line_width; | ||
27 | + gint horizontal_separator; | ||
28 | |||
29 | g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column)); | ||
30 | |||
31 | @@ -2590,7 +2604,10 @@ | ||
32 | if (width) | ||
33 | * width = 0; | ||
34 | |||
35 | - gtk_widget_style_get (tree_column->tree_view, "focus-line-width", &focus_line_width, NULL); | ||
36 | + gtk_widget_style_get (tree_column->tree_view, | ||
37 | + "focus-line-width", &focus_line_width, | ||
38 | + "horizontal-separator", &horizontal_separator, | ||
39 | + NULL); | ||
40 | |||
41 | for (list = tree_column->cell_list; list; list = list->next) | ||
42 | { | ||
43 | @@ -2618,7 +2635,7 @@ | ||
44 | * height = MAX (*height, new_height + focus_line_width * 2); | ||
45 | info->requested_width = MAX (info->requested_width, new_width + focus_line_width * 2); | ||
46 | if (width) | ||
47 | - * width += info->requested_width; | ||
48 | + * width += info->requested_width + horizontal_separator; | ||
49 | first_cell = FALSE; | ||
50 | } | ||
51 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktypebuiltins.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktypebuiltins.c.diff deleted file mode 100644 index 31b52e68a3..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktypebuiltins.c.diff +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktypebuiltins.c 2005-03-01 17:58:15.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktypebuiltins.c 2005-04-06 16:19:38.348708472 +0300 | ||
3 | @@ -25,6 +25,26 @@ | ||
4 | } | ||
5 | |||
6 | |||
7 | +/* enumerations from "gtkbutton.h" */ | ||
8 | +GType | ||
9 | +osso_gtk_button_attach_flags_get_type (void) | ||
10 | +{ | ||
11 | + static GType etype = 0; | ||
12 | + if (etype == 0) { | ||
13 | + static const GFlagsValue values[] = { | ||
14 | + { OSSO_GTK_BUTTON_ATTACH_NORTH, "OSSO_GTK_BUTTON_ATTACH_NORTH", "north" }, | ||
15 | + { OSSO_GTK_BUTTON_ATTACH_EAST, "OSSO_GTK_BUTTON_ATTACH_EAST", "east" }, | ||
16 | + { OSSO_GTK_BUTTON_ATTACH_SOUTH, "OSSO_GTK_BUTTON_ATTACH_SOUTH", "south" }, | ||
17 | + { OSSO_GTK_BUTTON_ATTACH_WEST, "OSSO_GTK_BUTTON_ATTACH_WEST", "west" }, | ||
18 | + { OSSO_GTK_BUTTON_ATTACH_ENUM_END, "OSSO_GTK_BUTTON_ATTACH_ENUM_END", "enum-end" }, | ||
19 | + { 0, NULL, NULL } | ||
20 | + }; | ||
21 | + etype = g_flags_register_static ("OssoGtkButtonAttachFlags", values); | ||
22 | + } | ||
23 | + return etype; | ||
24 | +} | ||
25 | + | ||
26 | + | ||
27 | /* enumerations from "gtkcalendar.h" */ | ||
28 | GType | ||
29 | gtk_calendar_display_options_get_type (void) | ||
30 | @@ -468,13 +488,17 @@ | ||
31 | static GType etype = 0; | ||
32 | if (etype == 0) { | ||
33 | static const GEnumValue values[] = { | ||
34 | - { GTK_ICON_SIZE_INVALID, "GTK_ICON_SIZE_INVALID", "invalid" }, | ||
35 | - { GTK_ICON_SIZE_MENU, "GTK_ICON_SIZE_MENU", "menu" }, | ||
36 | - { GTK_ICON_SIZE_SMALL_TOOLBAR, "GTK_ICON_SIZE_SMALL_TOOLBAR", "small-toolbar" }, | ||
37 | - { GTK_ICON_SIZE_LARGE_TOOLBAR, "GTK_ICON_SIZE_LARGE_TOOLBAR", "large-toolbar" }, | ||
38 | - { GTK_ICON_SIZE_BUTTON, "GTK_ICON_SIZE_BUTTON", "button" }, | ||
39 | - { GTK_ICON_SIZE_DND, "GTK_ICON_SIZE_DND", "dnd" }, | ||
40 | - { GTK_ICON_SIZE_DIALOG, "GTK_ICON_SIZE_DIALOG", "dialog" }, | ||
41 | + { GTK_ICON_SIZE_INVALID, "GTK_ICON_SIZE_INVALID", "gtk-icon-size-invalid" }, | ||
42 | + { GTK_ICON_SIZE_MENU, "GTK_ICON_SIZE_MENU", "gtk-icon-size-menu" }, | ||
43 | + { GTK_ICON_SIZE_SMALL_TOOLBAR, "GTK_ICON_SIZE_SMALL_TOOLBAR", "gtk-icon-size-small-toolbar" }, | ||
44 | + { GTK_ICON_SIZE_LARGE_TOOLBAR, "GTK_ICON_SIZE_LARGE_TOOLBAR", "gtk-icon-size-large-toolbar" }, | ||
45 | + { GTK_ICON_SIZE_BUTTON, "GTK_ICON_SIZE_BUTTON", "gtk-icon-size-button" }, | ||
46 | + { GTK_ICON_SIZE_DND, "GTK_ICON_SIZE_DND", "gtk-icon-size-dnd" }, | ||
47 | + { GTK_ICON_SIZE_DIALOG, "GTK_ICON_SIZE_DIALOG", "gtk-icon-size-dialog" }, | ||
48 | + { HILDON_ICON_SIZE_26, "HILDON_ICON_SIZE_26", "hildon-icon-size-26" }, | ||
49 | + { HILDON_ICON_SIZE_40, "HILDON_ICON_SIZE_40", "hildon-icon-size-40" }, | ||
50 | + { HILDON_ICON_SIZE_50, "HILDON_ICON_SIZE_50", "hildon-icon-size-50" }, | ||
51 | + { HILDON_ICON_SIZE_64, "HILDON_ICON_SIZE_64", "hildon-icon-size-64" }, | ||
52 | { 0, NULL, NULL } | ||
53 | }; | ||
54 | etype = g_enum_register_static ("GtkIconSize", values); | ||
55 | @@ -1390,6 +1414,7 @@ | ||
56 | { GTK_RC_TOKEN_STOCK, "GTK_RC_TOKEN_STOCK", "stock" }, | ||
57 | { GTK_RC_TOKEN_LTR, "GTK_RC_TOKEN_LTR", "ltr" }, | ||
58 | { GTK_RC_TOKEN_RTL, "GTK_RC_TOKEN_RTL", "rtl" }, | ||
59 | + { GTK_RC_TOKEN_LOGICAL_COLOR, "GTK_RC_TOKEN_LOGICAL_COLOR", "logical-color" }, | ||
60 | { GTK_RC_TOKEN_LAST, "GTK_RC_TOKEN_LAST", "last" }, | ||
61 | { 0, NULL, NULL } | ||
62 | }; | ||
63 | @@ -1673,6 +1698,23 @@ | ||
64 | return etype; | ||
65 | } | ||
66 | |||
67 | +GType | ||
68 | +gtk_widget_tap_and_hold_flags_get_type (void) | ||
69 | +{ | ||
70 | + static GType etype = 0; | ||
71 | + if (etype == 0) { | ||
72 | + static const GFlagsValue values[] = { | ||
73 | + { GTK_TAP_AND_HOLD_NONE, "GTK_TAP_AND_HOLD_NONE", "none" }, | ||
74 | + { GTK_TAP_AND_HOLD_PASS_PRESS, "GTK_TAP_AND_HOLD_PASS_PRESS", "pass-press" }, | ||
75 | + { GTK_TAP_AND_HOLD_NO_SIGNALS, "GTK_TAP_AND_HOLD_NO_SIGNALS", "no-signals" }, | ||
76 | + { GTK_TAP_AND_HOLD_NO_INTERNALS, "GTK_TAP_AND_HOLD_NO_INTERNALS", "no-internals" }, | ||
77 | + { 0, NULL, NULL } | ||
78 | + }; | ||
79 | + etype = g_flags_register_static ("GtkWidgetTapAndHoldFlags", values); | ||
80 | + } | ||
81 | + return etype; | ||
82 | +} | ||
83 | + | ||
84 | |||
85 | /* Generated data ends here */ | ||
86 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktypebuiltins.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktypebuiltins.h.diff deleted file mode 100644 index ac266dbaf6..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktypebuiltins.h.diff +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtktypebuiltins.h 2005-03-01 17:58:16.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtktypebuiltins.h 2005-04-06 16:19:38.348708472 +0300 | ||
3 | @@ -13,6 +13,11 @@ | ||
4 | GType gtk_accel_flags_get_type (void) G_GNUC_CONST; | ||
5 | #define GTK_TYPE_ACCEL_FLAGS (gtk_accel_flags_get_type()) | ||
6 | |||
7 | +/* enumerations from "gtkbutton.h" */ | ||
8 | + | ||
9 | +GType osso_gtk_button_attach_flags_get_type (void) G_GNUC_CONST; | ||
10 | +#define GTK_TYPE_GTK_BUTTON_ATTACH_FLAGS (osso_gtk_button_attach_flags_get_type()) | ||
11 | + | ||
12 | /* enumerations from "gtkcalendar.h" */ | ||
13 | |||
14 | GType gtk_calendar_display_options_get_type (void) G_GNUC_CONST; | ||
15 | @@ -335,6 +340,9 @@ | ||
16 | GType gtk_widget_help_type_get_type (void) G_GNUC_CONST; | ||
17 | #define GTK_TYPE_WIDGET_HELP_TYPE (gtk_widget_help_type_get_type()) | ||
18 | |||
19 | +GType gtk_widget_tap_and_hold_flags_get_type (void) G_GNUC_CONST; | ||
20 | +#define GTK_TYPE_WIDGET_TAP_AND_HOLD_FLAGS (gtk_widget_tap_and_hold_flags_get_type()) | ||
21 | + | ||
22 | G_END_DECLS | ||
23 | |||
24 | #endif /* __GTK_TYPE_BUILTINS_H__ */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkvseparator.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkvseparator.c.diff deleted file mode 100644 index f4b1c00900..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkvseparator.c.diff +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkvseparator.c 2004-08-09 19:59:53.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gtk/gtkvseparator.c 2005-04-06 16:19:38.356707256 +0300 | ||
3 | @@ -91,13 +91,34 @@ | ||
4 | gtk_vseparator_expose (GtkWidget *widget, | ||
5 | GdkEventExpose *event) | ||
6 | { | ||
7 | - if (GTK_WIDGET_DRAWABLE (widget)) | ||
8 | - gtk_paint_vline (widget->style, widget->window, GTK_WIDGET_STATE (widget), | ||
9 | - &event->area, widget, "vseparator", | ||
10 | - widget->allocation.y, | ||
11 | - widget->allocation.y + widget->allocation.height - 1, | ||
12 | - widget->allocation.x + (widget->allocation.width - | ||
13 | - widget->style->xthickness) / 2); | ||
14 | + gboolean hildonlike_drawing = FALSE; | ||
15 | |||
16 | - return FALSE; | ||
17 | + | ||
18 | + gtk_widget_style_get ( widget, "hildonlike-drawing", &hildonlike_drawing, NULL ); | ||
19 | + | ||
20 | + if (GTK_WIDGET_DRAWABLE (widget)) | ||
21 | + { | ||
22 | + if(hildonlike_drawing) | ||
23 | + gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, | ||
24 | + GTK_SHADOW_NONE, &event->area, widget, "vseparator", | ||
25 | + widget->allocation.x + (widget->allocation.width - | ||
26 | + widget->style->xthickness) / 2, | ||
27 | + widget->allocation.y, | ||
28 | + | ||
29 | + widget->style->xthickness, | ||
30 | + widget->allocation.height - 1); | ||
31 | + else | ||
32 | + gtk_paint_vline (widget->style, widget->window, GTK_STATE_NORMAL, | ||
33 | + &event->area, widget, "vseparator", | ||
34 | + widget->allocation.y, | ||
35 | + widget->allocation.y + widget->allocation.height - 1, | ||
36 | + widget->allocation.x + (widget->allocation.width - | ||
37 | + widget->style->xthickness) / 2); | ||
38 | + } | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + return FALSE; | ||
45 | } | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwidget.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwidget.c.diff deleted file mode 100644 index ecef0041eb..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwidget.c.diff +++ /dev/null | |||
@@ -1,1046 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkwidget.c 2005-02-24 18:44:02.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkwidget.c 2005-04-06 16:19:38.386702696 +0300 | ||
3 | @@ -28,6 +28,8 @@ | ||
4 | #include <stdarg.h> | ||
5 | #include <string.h> | ||
6 | #include <locale.h> | ||
7 | +#include <stdlib.h> | ||
8 | +#include <x11/gdkx.h> | ||
9 | #include "gtkalias.h" | ||
10 | #include "gtkcontainer.h" | ||
11 | #include "gtkaccelmap.h" | ||
12 | @@ -44,6 +46,11 @@ | ||
13 | #include "gtkwindow.h" | ||
14 | #include "gtkbindings.h" | ||
15 | #include "gtkprivate.h" | ||
16 | +#include "gtktreeview.h" | ||
17 | +#include "gtkentry.h" | ||
18 | +#include "gtktextview.h" | ||
19 | +#include "gtkimcontext.h" | ||
20 | +#include "gtkmenu.h" | ||
21 | #include "gdk/gdk.h" | ||
22 | #include "gdk/gdkprivate.h" /* Used in gtk_reset_shapes_recurse to avoid copy */ | ||
23 | #include <gobject/gvaluecollector.h> | ||
24 | @@ -53,11 +60,30 @@ | ||
25 | #include "gtkaccessible.h" | ||
26 | #include "gtktooltips.h" | ||
27 | #include "gtkinvisible.h" | ||
28 | +#include "gtkscrollbar.h" /* Following are needed for special focus changes */ | ||
29 | +#include "gtktoolbar.h" | ||
30 | +#include "gtkmenu.h" | ||
31 | +#include "gtkmenuitem.h" | ||
32 | +#include "gtktogglebutton.h" | ||
33 | +#include "gtkcomboboxentry.h" | ||
34 | +#include "gtktogglebutton.h" | ||
35 | +#include "gtkcomboboxentry.h" | ||
36 | |||
37 | #define WIDGET_CLASS(w) GTK_WIDGET_GET_CLASS (w) | ||
38 | #define INIT_PATH_SIZE (512) | ||
39 | |||
40 | +#define GTK_TAP_THRESHOLD 30 | ||
41 | +#define GTK_TAP_MENU_THRESHOLD 20 | ||
42 | +#define GTK_TAP_AND_HOLD_TIMER_COUNTER 11 | ||
43 | +#define GTK_TAP_AND_HOLD_TIMER_INTERVAL 100 | ||
44 | |||
45 | +typedef struct _GtkWidgetPrivate GtkWidgetPrivate; | ||
46 | + | ||
47 | +#define GTK_WIDGET_GET_PRIVATE(obj) ( G_TYPE_INSTANCE_GET_PRIVATE ((obj),\ | ||
48 | + GTK_TYPE_WIDGET, GtkWidgetPrivate) ) | ||
49 | + | ||
50 | +#define TAP_AND_HOLD_ANIMATION 1 | ||
51 | + | ||
52 | enum { | ||
53 | SHOW, | ||
54 | HIDE, | ||
55 | @@ -120,6 +146,9 @@ | ||
56 | ACCEL_CLOSURES_CHANGED, | ||
57 | SCREEN_CHANGED, | ||
58 | CAN_ACTIVATE_ACCEL, | ||
59 | + INSENSITIVE_PRESS, | ||
60 | + TAP_AND_HOLD, | ||
61 | + TAP_AND_HOLD_SETUP, | ||
62 | LAST_SIGNAL | ||
63 | }; | ||
64 | |||
65 | @@ -142,7 +171,8 @@ | ||
66 | PROP_STYLE, | ||
67 | PROP_EVENTS, | ||
68 | PROP_EXTENSION_EVENTS, | ||
69 | - PROP_NO_SHOW_ALL | ||
70 | + PROP_NO_SHOW_ALL, | ||
71 | + PROP_TAP_AND_HOLD | ||
72 | }; | ||
73 | |||
74 | typedef struct _GtkStateData GtkStateData; | ||
75 | @@ -155,7 +185,50 @@ | ||
76 | guint use_forall : 1; | ||
77 | }; | ||
78 | |||
79 | +struct _GtkWidgetPrivate | ||
80 | +{ | ||
81 | + GtkWidget *menu; | ||
82 | + guint timer_id; | ||
83 | + | ||
84 | + GtkStateType stype; | ||
85 | + GtkStateType type_on_press; | ||
86 | + GdkEvent *fake_event; | ||
87 | + GtkMenuPositionFunc func; | ||
88 | + gint x, y; | ||
89 | + gint timer_counter; | ||
90 | + gint run_press : 1; | ||
91 | + gint button_pressed : 1; | ||
92 | + gint signals_connected : 1; | ||
93 | + GtkWidgetTapAndHoldFlags flags; | ||
94 | + gboolean state_set; | ||
95 | + guint interval; | ||
96 | + | ||
97 | +#ifdef TAP_AND_HOLD_ANIMATION | ||
98 | + GdkPixbufAnimation *anim; | ||
99 | + GdkPixbufAnimationIter *iter; | ||
100 | + guint width, height; | ||
101 | +#endif | ||
102 | +}; | ||
103 | + | ||
104 | |||
105 | +/* --- Tap And Hold --- */ | ||
106 | +static gboolean gtk_widget_tap_and_hold_button_press_with_events( GtkWidget *widget, | ||
107 | + GdkEvent *event, GtkWidgetPrivate *priv ); | ||
108 | +static gboolean gtk_widget_tap_and_hold_button_release_with_events( GtkWidget *widget, | ||
109 | + GdkEvent *event, GtkWidgetPrivate *priv ); | ||
110 | +static gboolean gtk_widget_tap_and_hold_leave_notify_with_events( GtkWidget *widget, | ||
111 | + GdkEvent *event, GtkWidgetPrivate *priv ); | ||
112 | +static gboolean gtk_widget_tap_and_hold_timeout_with_events( GtkWidget *widget ); | ||
113 | +static gboolean gtk_widget_tap_and_hold_timeout( GtkWidget *widget ); | ||
114 | +static gboolean gtk_widget_tap_and_hold_button_press( GtkWidget *widget, | ||
115 | + GdkEvent *event, GtkWidgetPrivate *priv ); | ||
116 | +static gboolean gtk_widget_tap_and_hold_button_release( GtkWidget *widget, | ||
117 | + GdkEvent *event, GtkWidgetPrivate *priv ); | ||
118 | +static gboolean gtk_widget_tap_and_hold_leave_notify( GtkWidget *widget, | ||
119 | + GdkEvent *event, GtkWidgetPrivate *priv ); | ||
120 | +static void gtk_widget_tap_and_hold_setup_real( GtkWidget *widget, | ||
121 | + GtkWidget *menu, GtkCallback func, GtkWidgetTapAndHoldFlags flags ); | ||
122 | +static void gtk_widget_real_tap_and_hold(GtkWidget *widget); | ||
123 | /* --- prototypes --- */ | ||
124 | static void gtk_widget_class_init (GtkWidgetClass *klass); | ||
125 | static void gtk_widget_init (GtkWidget *widget); | ||
126 | @@ -228,6 +301,13 @@ | ||
127 | gint width, | ||
128 | gint height); | ||
129 | |||
130 | +/*Hildon focus handling*/ | ||
131 | +static void gtk_widget_set_focus_handling( GtkWidget *widget, gboolean state ); | ||
132 | + | ||
133 | +static gboolean gtk_widget_enter_notify_event( GtkWidget *widget, GdkEventCrossing *event ); | ||
134 | +static gboolean gtk_widget_leave_notify_event( GtkWidget *widget, GdkEventCrossing *event ); | ||
135 | +static gint gtk_widget_button_release_event( GtkWidget *widget, GdkEventButton *event ); | ||
136 | +static gint gtk_widget_button_press_event( GtkWidget *widget, GdkEventButton *event ); | ||
137 | |||
138 | /* --- variables --- */ | ||
139 | static gpointer parent_class = NULL; | ||
140 | @@ -239,6 +319,9 @@ | ||
141 | static GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR; | ||
142 | static GParamSpecPool *style_property_spec_pool = NULL; | ||
143 | |||
144 | +static gboolean on_same_widget = FALSE; /*Hildon focus handling*/ | ||
145 | +static gboolean mouse_pressed = FALSE; /*Hildon focus handling*/ | ||
146 | + | ||
147 | static GQuark quark_property_parser = 0; | ||
148 | static GQuark quark_aux_info = 0; | ||
149 | static GQuark quark_accel_path = 0; | ||
150 | @@ -396,6 +479,9 @@ | ||
151 | klass->drag_data_received = NULL; | ||
152 | klass->screen_changed = NULL; | ||
153 | klass->can_activate_accel = gtk_widget_real_can_activate_accel; | ||
154 | + klass->tap_and_hold_setup = gtk_widget_tap_and_hold_setup_real; | ||
155 | + klass->insensitive_press = NULL; | ||
156 | + klass->tap_and_hold = gtk_widget_real_tap_and_hold; | ||
157 | |||
158 | klass->show_help = gtk_widget_real_show_help; | ||
159 | |||
160 | @@ -404,6 +490,18 @@ | ||
161 | |||
162 | klass->no_expose_event = NULL; | ||
163 | |||
164 | + g_type_class_add_private( klass, sizeof(GtkWidgetPrivate) ); | ||
165 | + | ||
166 | + g_object_class_install_property (gobject_class, | ||
167 | + PROP_TAP_AND_HOLD, | ||
168 | + g_param_spec_int ("tap_and_hold_state", | ||
169 | + P_("Tap and hold State type"), | ||
170 | + P_("Sets the state to be used to the tap and hold functionality. The default is GTK_STATE_NORMAL"), | ||
171 | + 0, | ||
172 | + 4, /*4 == Last state in GTK+-2.0*/ | ||
173 | + GTK_STATE_NORMAL, | ||
174 | + G_PARAM_READWRITE)); | ||
175 | + | ||
176 | g_object_class_install_property (gobject_class, | ||
177 | PROP_NAME, | ||
178 | g_param_spec_string ("name", | ||
179 | @@ -1389,6 +1487,31 @@ | ||
180 | _gtk_marshal_BOOLEAN__UINT, | ||
181 | G_TYPE_BOOLEAN, 1, G_TYPE_UINT); | ||
182 | |||
183 | + widget_signals[INSENSITIVE_PRESS] = | ||
184 | + g_signal_new ("insensitive_press", | ||
185 | + G_TYPE_FROM_CLASS (gobject_class), | ||
186 | + G_SIGNAL_RUN_FIRST, | ||
187 | + G_STRUCT_OFFSET (GtkWidgetClass, insensitive_press), | ||
188 | + NULL, NULL, | ||
189 | + _gtk_marshal_VOID__VOID, | ||
190 | + G_TYPE_NONE, 0); | ||
191 | + | ||
192 | + widget_signals[TAP_AND_HOLD] = | ||
193 | + g_signal_new("tap-and-hold", G_TYPE_FROM_CLASS(gobject_class), | ||
194 | + G_SIGNAL_RUN_LAST, | ||
195 | + G_STRUCT_OFFSET(GtkWidgetClass, tap_and_hold), | ||
196 | + NULL, NULL, | ||
197 | + _gtk_marshal_VOID__VOID, | ||
198 | + G_TYPE_NONE, 0); | ||
199 | + | ||
200 | + widget_signals[TAP_AND_HOLD_SETUP] = | ||
201 | + g_signal_new("tap-and-hold-setup", G_TYPE_FROM_CLASS(gobject_class), | ||
202 | + G_SIGNAL_RUN_LAST, | ||
203 | + G_STRUCT_OFFSET(GtkWidgetClass, tap_and_hold_setup), | ||
204 | + NULL, NULL, /*FIXME -- OBJECT_POINTER_FLAGS*/ | ||
205 | + _gtk_marshal_VOID__OBJECT_UINT_FLAGS, | ||
206 | + G_TYPE_NONE, 3, G_TYPE_OBJECT, G_TYPE_POINTER, G_TYPE_UINT); | ||
207 | + | ||
208 | binding_set = gtk_binding_set_by_class (klass); | ||
209 | gtk_binding_entry_add_signal (binding_set, GDK_F10, GDK_SHIFT_MASK, | ||
210 | "popup_menu", 0); | ||
211 | @@ -1418,7 +1541,12 @@ | ||
212 | P_("Whether to draw the focus indicator inside widgets"), | ||
213 | TRUE, | ||
214 | G_PARAM_READABLE)); | ||
215 | - | ||
216 | + gtk_widget_class_install_style_property (klass, | ||
217 | + g_param_spec_boolean ("hildon-focus-handling", | ||
218 | + P_("Hildon focus handling"), | ||
219 | + P_("Whether the widget is using the hildon like focus handling or not"), | ||
220 | + FALSE, | ||
221 | + G_PARAM_READABLE)); | ||
222 | gtk_widget_class_install_style_property (klass, | ||
223 | g_param_spec_int ("focus-line-width", | ||
224 | P_("Focus linewidth"), | ||
225 | @@ -1543,6 +1671,8 @@ | ||
226 | case PROP_NO_SHOW_ALL: | ||
227 | gtk_widget_set_no_show_all (widget, g_value_get_boolean (value)); | ||
228 | break; | ||
229 | + case PROP_TAP_AND_HOLD: | ||
230 | + GTK_WIDGET_GET_PRIVATE(widget)->type_on_press = g_value_get_int(value); | ||
231 | default: | ||
232 | break; | ||
233 | } | ||
234 | @@ -1637,16 +1767,45 @@ | ||
235 | case PROP_NO_SHOW_ALL: | ||
236 | g_value_set_boolean (value, gtk_widget_get_no_show_all (widget)); | ||
237 | break; | ||
238 | + case PROP_TAP_AND_HOLD: | ||
239 | + g_value_set_int (value, | ||
240 | + (int)GTK_WIDGET_GET_PRIVATE(widget)->type_on_press); | ||
241 | default: | ||
242 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
243 | break; | ||
244 | } | ||
245 | } | ||
246 | |||
247 | +static void gtk_widget_set_focus_handling( GtkWidget *widget, gboolean state ) | ||
248 | +{ | ||
249 | + GtkWidgetPrivate *priv; | ||
250 | + priv = GTK_WIDGET_GET_PRIVATE (widget); | ||
251 | + | ||
252 | + if( state && GTK_WIDGET_CAN_FOCUS(widget) ) | ||
253 | + { | ||
254 | + if (!priv->state_set) | ||
255 | + { | ||
256 | + g_signal_connect( G_OBJECT(widget), "button-press-event", | ||
257 | + G_CALLBACK(gtk_widget_button_press_event), NULL ); | ||
258 | + g_signal_connect( G_OBJECT(widget), "button-release-event", | ||
259 | + G_CALLBACK(gtk_widget_button_release_event), NULL ); | ||
260 | + g_signal_connect( G_OBJECT(widget), "enter-notify-event", | ||
261 | + G_CALLBACK(gtk_widget_enter_notify_event), NULL ); | ||
262 | + g_signal_connect( G_OBJECT(widget), "leave-notify-event", | ||
263 | + G_CALLBACK(gtk_widget_leave_notify_event), NULL ); | ||
264 | + priv->state_set = TRUE; | ||
265 | + } | ||
266 | + } | ||
267 | +} | ||
268 | + | ||
269 | static void | ||
270 | gtk_widget_init (GtkWidget *widget) | ||
271 | { | ||
272 | + GtkWidgetPrivate *priv; | ||
273 | GTK_PRIVATE_FLAGS (widget) = PRIVATE_GTK_CHILD_VISIBLE; | ||
274 | + | ||
275 | + priv = GTK_WIDGET_GET_PRIVATE(widget); | ||
276 | + | ||
277 | widget->state = GTK_STATE_NORMAL; | ||
278 | widget->saved_state = GTK_STATE_NORMAL; | ||
279 | widget->name = NULL; | ||
280 | @@ -1659,6 +1818,18 @@ | ||
281 | widget->window = NULL; | ||
282 | widget->parent = NULL; | ||
283 | |||
284 | + priv->fake_event = NULL; | ||
285 | + priv->timer_id = 0; | ||
286 | + priv->menu = NULL; | ||
287 | + priv->run_press = TRUE; | ||
288 | + priv->signals_connected = FALSE; | ||
289 | + priv->x = priv->y = 0; | ||
290 | + priv->func = NULL; | ||
291 | + priv->timer_counter = 0; | ||
292 | + priv->flags = 0x0; | ||
293 | + priv->state_set = FALSE; | ||
294 | + priv->interval = GTK_TAP_AND_HOLD_TIMER_INTERVAL; | ||
295 | + | ||
296 | GTK_WIDGET_SET_FLAGS (widget, | ||
297 | GTK_SENSITIVE | | ||
298 | GTK_PARENT_SENSITIVE | | ||
299 | @@ -1670,6 +1841,7 @@ | ||
300 | GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED); | ||
301 | |||
302 | widget->style = gtk_widget_get_default_style (); | ||
303 | + | ||
304 | g_object_ref (widget->style); | ||
305 | } | ||
306 | |||
307 | @@ -2153,6 +2325,7 @@ | ||
308 | |||
309 | if ((GTK_WIDGET_FLAGS (widget) & GTK_NO_SHOW_ALL) != 0) | ||
310 | return; | ||
311 | + | ||
312 | |||
313 | class = GTK_WIDGET_GET_CLASS (widget); | ||
314 | |||
315 | @@ -3400,6 +3573,127 @@ | ||
316 | return FALSE; | ||
317 | } | ||
318 | |||
319 | +/** | ||
320 | + * gtk_widget_button_press_event | ||
321 | + * @widget: a #GtkWidget | ||
322 | + * @event: a #GtkEventKey | ||
323 | + * | ||
324 | +**/ | ||
325 | +static gboolean gtk_widget_button_press_event(GtkWidget *widget, GdkEventButton *event ) | ||
326 | +{ | ||
327 | + if( !mouse_pressed /*&& !GTK_IS_TREE_VIEW(widget) && !GTK_IS_ENTRY(widget)*/ ) | ||
328 | + { | ||
329 | + GtkWidget *toplevel; | ||
330 | + toplevel = gtk_widget_get_toplevel (widget); | ||
331 | + if (GTK_IS_WINDOW (toplevel)) | ||
332 | + { | ||
333 | + mouse_pressed = TRUE; | ||
334 | + | ||
335 | + if( /*!gtk_window_get_prev_focus_widget(GTK_WINDOW(toplevel)) &&*/ | ||
336 | + GTK_IS_WIDGET(GTK_WINDOW(toplevel)->focus_widget) ) | ||
337 | + gtk_window_set_prev_focus_widget( GTK_WINDOW(toplevel), | ||
338 | + GTK_WINDOW(toplevel)->focus_widget ); | ||
339 | + } | ||
340 | + } | ||
341 | + return FALSE; | ||
342 | +} | ||
343 | + | ||
344 | +/** | ||
345 | + * gtk_widget_button_release_event | ||
346 | + * @widget: a #GtkWidget | ||
347 | + * @event: a #GtkEventKey | ||
348 | + * | ||
349 | +**/ | ||
350 | +static gboolean gtk_widget_button_release_event(GtkWidget *widget, GdkEventButton *event ) | ||
351 | +{ | ||
352 | + if( mouse_pressed /*&& !GTK_IS_ENTRY(widget)*/ ) | ||
353 | + { | ||
354 | + GtkWidget *toplevel; | ||
355 | + GtkWidget *event_widget; | ||
356 | + event_widget = gtk_get_event_widget( (GdkEvent*) event ); | ||
357 | + toplevel = gtk_widget_get_toplevel (widget); | ||
358 | + | ||
359 | + mouse_pressed = FALSE; | ||
360 | + on_same_widget = TRUE; | ||
361 | + | ||
362 | + if (GTK_IS_WINDOW (toplevel)) | ||
363 | + { | ||
364 | + if( !on_same_widget && GTK_IS_WIDGET(GTK_WINDOW(toplevel)->focus_widget) ) | ||
365 | + gtk_window_set_prev_focus_widget( GTK_WINDOW(toplevel), GTK_WINDOW(toplevel)->focus_widget ); | ||
366 | + else | ||
367 | + gtk_window_set_prev_focus_widget( GTK_WINDOW(toplevel), event_widget ); | ||
368 | + } | ||
369 | + } | ||
370 | + return FALSE; | ||
371 | +} | ||
372 | + | ||
373 | +/** | ||
374 | + * gtk_widget_enter_notify_event | ||
375 | + * @widget: a #GtkWidget | ||
376 | + * @event: a #GtkEventCrossing | ||
377 | + * | ||
378 | +**/ | ||
379 | +static gboolean gtk_widget_enter_notify_event( GtkWidget *widget, GdkEventCrossing *event ) | ||
380 | +{ | ||
381 | + GtkWidget *toplevel; | ||
382 | + GtkWidget *event_widget; | ||
383 | + /*if( GTK_IS_ENTRY(widget) ) | ||
384 | + return FALSE;*/ | ||
385 | + | ||
386 | + toplevel = gtk_widget_get_toplevel (widget); | ||
387 | + event_widget = gtk_get_event_widget ( (GdkEvent*) event ); | ||
388 | + | ||
389 | + if(mouse_pressed && !on_same_widget && gtk_window_get_prev_focus_widget( GTK_WINDOW(toplevel) ) == event_widget) | ||
390 | + { | ||
391 | +/* GtkWidget *temp;*/ | ||
392 | + on_same_widget = TRUE; | ||
393 | + | ||
394 | +/* temp = gtk_window_get_prev_focus_widget( GTK_WINDOW(toplevel) );*/ | ||
395 | + if( GTK_IS_WIDGET(GTK_WINDOW(toplevel)->focus_widget) ) | ||
396 | + { | ||
397 | + gtk_window_set_prev_focus_widget( GTK_WINDOW(toplevel), GTK_WINDOW(toplevel)->focus_widget ); | ||
398 | + if( GTK_WIDGET_CAN_FOCUS(event_widget) ) | ||
399 | + gtk_widget_grab_focus( event_widget ); | ||
400 | + else | ||
401 | + gtk_widget_activate( event_widget ); | ||
402 | + } | ||
403 | + } | ||
404 | + return FALSE; | ||
405 | +} | ||
406 | + | ||
407 | + | ||
408 | +/** | ||
409 | + * gtk_widget_leave_notify_event | ||
410 | + * @widget: a #GtkWidget | ||
411 | + * @event: a #GtkEventCrossing | ||
412 | + * | ||
413 | +**/ | ||
414 | +static gboolean gtk_widget_leave_notify_event( GtkWidget *widget, GdkEventCrossing *event ) | ||
415 | +{ | ||
416 | + if( mouse_pressed && on_same_widget /*&& !GTK_IS_ENTRY(widget)*/ ) | ||
417 | + { | ||
418 | + GtkWidget *event_widget; | ||
419 | + GtkWidget *toplevel; | ||
420 | + GtkWidget *temp; | ||
421 | + toplevel = gtk_widget_get_toplevel( widget ); | ||
422 | + event_widget = gtk_get_event_widget( (GdkEvent*) event ); | ||
423 | + on_same_widget = FALSE; | ||
424 | + | ||
425 | + temp = gtk_window_get_prev_focus_widget( GTK_WINDOW(toplevel) ); | ||
426 | + if( GTK_IS_WIDGET(temp) && | ||
427 | + gtk_window_has_toplevel_focus(GTK_WINDOW(toplevel)) ) | ||
428 | + { | ||
429 | + gtk_window_set_prev_focus_widget( GTK_WINDOW(toplevel), event_widget ); | ||
430 | + if( GTK_WIDGET_CAN_FOCUS(temp) ) | ||
431 | + gtk_widget_grab_focus( temp ); | ||
432 | + else | ||
433 | + gtk_widget_activate( temp ); | ||
434 | + } | ||
435 | + } | ||
436 | + return FALSE; | ||
437 | +} | ||
438 | + | ||
439 | + | ||
440 | #define WIDGET_REALIZED_FOR_EVENT(widget, event) \ | ||
441 | (event->type == GDK_FOCUS_CHANGE || GTK_WIDGET_REALIZED(widget)) | ||
442 | |||
443 | @@ -3947,11 +4241,14 @@ | ||
444 | static void | ||
445 | gtk_widget_real_grab_focus (GtkWidget *focus_widget) | ||
446 | { | ||
447 | - if (GTK_WIDGET_CAN_FOCUS (focus_widget)) | ||
448 | + if (GTK_WIDGET_CAN_FOCUS (focus_widget) && | ||
449 | + GTK_WIDGET_VISIBLE (focus_widget)) | ||
450 | { | ||
451 | + static GtkIMContext *last_context = NULL; | ||
452 | GtkWidget *toplevel; | ||
453 | GtkWidget *widget; | ||
454 | - | ||
455 | + GtkIMContext *context; | ||
456 | + | ||
457 | /* clear the current focus setting, break if the current widget | ||
458 | * is the focus widget's parent, since containers above that will | ||
459 | * be set by the next loop. | ||
460 | @@ -3972,6 +4269,53 @@ | ||
461 | |||
462 | return; | ||
463 | } | ||
464 | + | ||
465 | + /* Focus change stuff (previously in modified im context) */ | ||
466 | + if (GTK_IS_ENTRY (widget)) | ||
467 | + context = GTK_ENTRY (widget)->im_context; | ||
468 | + else if (GTK_IS_TEXT_VIEW (widget)) | ||
469 | + context = GTK_TEXT_VIEW (widget)->im_context; | ||
470 | + else | ||
471 | + context = NULL; | ||
472 | + | ||
473 | + if (context || last_context) | ||
474 | + { | ||
475 | + gboolean is_combo, is_inside_toolbar; | ||
476 | + GtkWidget *parent; | ||
477 | + | ||
478 | + parent = gtk_widget_get_parent (focus_widget); | ||
479 | + is_combo = GTK_IS_TOGGLE_BUTTON (focus_widget) && | ||
480 | + (GTK_IS_COMBO_BOX_ENTRY (parent) || | ||
481 | + GTK_IS_COMBO_BOX (parent)); | ||
482 | + is_inside_toolbar = | ||
483 | + gtk_widget_get_ancestor (focus_widget, | ||
484 | + GTK_TYPE_TOOLBAR) != NULL; | ||
485 | + | ||
486 | + if (focus_widget == NULL || | ||
487 | + !GTK_IS_ENTRY (focus_widget) && | ||
488 | + !GTK_IS_TEXT_VIEW (focus_widget) && | ||
489 | + !GTK_IS_SCROLLBAR (focus_widget) && | ||
490 | + !GTK_IS_MENU_ITEM (focus_widget) && | ||
491 | + !GTK_IS_MENU (focus_widget) && | ||
492 | + !is_inside_toolbar && | ||
493 | + !is_combo) | ||
494 | + { | ||
495 | + /* we can't hide IM without IM context. it's possible to move | ||
496 | + * focus to widget which doesn't have IM context, but which | ||
497 | + * doesn't want IM to be hidden either. So, we have this | ||
498 | + * static last_context variable which is used... */ | ||
499 | + gtk_im_context_hide (context != NULL | ||
500 | + ? context : last_context); | ||
501 | + } | ||
502 | + | ||
503 | + if (context) | ||
504 | + { | ||
505 | + if (last_context != NULL) | ||
506 | + g_object_unref (last_context); | ||
507 | + last_context = context; | ||
508 | + g_object_ref (last_context); | ||
509 | + } | ||
510 | + } | ||
511 | |||
512 | if (widget) | ||
513 | { | ||
514 | @@ -4462,9 +4806,13 @@ | ||
515 | { | ||
516 | g_return_if_fail (GTK_IS_WIDGET (widget)); | ||
517 | |||
518 | - if (!GTK_WIDGET_USER_STYLE (widget) && | ||
519 | - !GTK_WIDGET_RC_STYLE (widget)) | ||
520 | + if (!GTK_WIDGET_USER_STYLE (widget) && !GTK_WIDGET_RC_STYLE (widget)) | ||
521 | + { | ||
522 | + gboolean hfh = FALSE; | ||
523 | gtk_widget_reset_rc_style (widget); | ||
524 | + gtk_widget_style_get( widget, "hildon-focus-handling", &hfh, NULL ); | ||
525 | + gtk_widget_set_focus_handling( widget, hfh ); | ||
526 | + } | ||
527 | } | ||
528 | |||
529 | /* Look up the RC style for this widget, unsetting any user style that | ||
530 | @@ -6396,7 +6744,7 @@ | ||
531 | |||
532 | if (!GTK_WIDGET_DIRECTION_SET (widget)) | ||
533 | gtk_widget_emit_direction_changed (widget, old_dir); | ||
534 | - | ||
535 | + | ||
536 | if (GTK_IS_CONTAINER (widget)) | ||
537 | gtk_container_forall (GTK_CONTAINER (widget), | ||
538 | gtk_widget_set_default_direction_recurse, | ||
539 | @@ -6405,6 +6753,13 @@ | ||
540 | g_object_unref (widget); | ||
541 | } | ||
542 | |||
543 | +/* Non static */ | ||
544 | +void gtk_widget_set_direction_recursive(GtkWidget * widget, GtkTextDirection dir ) | ||
545 | +{ | ||
546 | + gtk_widget_set_default_direction_recurse( widget, GUINT_TO_POINTER(dir) ); | ||
547 | +} | ||
548 | + | ||
549 | + | ||
550 | /** | ||
551 | * gtk_widget_set_default_direction: | ||
552 | * @dir: the new default direction. This cannot be | ||
553 | @@ -6422,7 +6777,7 @@ | ||
554 | { | ||
555 | GList *toplevels, *tmp_list; | ||
556 | GtkTextDirection old_dir = gtk_default_direction; | ||
557 | - | ||
558 | + | ||
559 | gtk_default_direction = dir; | ||
560 | |||
561 | tmp_list = toplevels = gtk_window_list_toplevels (); | ||
562 | @@ -6497,6 +6852,7 @@ | ||
563 | gtk_widget_finalize (GObject *object) | ||
564 | { | ||
565 | GtkWidget *widget = GTK_WIDGET (object); | ||
566 | + GtkWidgetPrivate *priv = GTK_WIDGET_GET_PRIVATE(object); | ||
567 | GtkWidgetAuxInfo *aux_info; | ||
568 | gint *events; | ||
569 | GdkExtensionMode *mode; | ||
570 | @@ -6507,6 +6863,12 @@ | ||
571 | g_object_unref (widget->style); | ||
572 | widget->style = NULL; | ||
573 | |||
574 | + if (priv->timer_id) | ||
575 | + { | ||
576 | + g_source_remove (priv->timer_id); | ||
577 | + priv->timer_id = 0; | ||
578 | + } | ||
579 | + | ||
580 | if (widget->name) | ||
581 | g_free (widget->name); | ||
582 | |||
583 | @@ -6526,6 +6888,12 @@ | ||
584 | if (accessible) | ||
585 | g_object_unref (accessible); | ||
586 | |||
587 | + if (GTK_IS_MENU(priv->menu)) | ||
588 | + gtk_widget_destroy (priv->menu); | ||
589 | + | ||
590 | + if (priv->fake_event) | ||
591 | + gdk_event_free (priv->fake_event); | ||
592 | + | ||
593 | G_OBJECT_CLASS (parent_class)->finalize (object); | ||
594 | } | ||
595 | |||
596 | @@ -7577,3 +7945,450 @@ | ||
597 | |||
598 | g_object_notify (G_OBJECT (widget), "no_show_all"); | ||
599 | } | ||
600 | + | ||
601 | +void gtk_widget_insensitive_press ( GtkWidget *widget ) | ||
602 | +{ | ||
603 | + g_return_if_fail (GTK_IS_WIDGET (widget)); | ||
604 | + | ||
605 | + g_signal_emit(widget, widget_signals[INSENSITIVE_PRESS], 0); | ||
606 | +} | ||
607 | + | ||
608 | +/*Tap And Hold*/ | ||
609 | + | ||
610 | +#ifdef TAP_AND_HOLD_ANIMATION | ||
611 | +static void | ||
612 | +init_tap_and_hold_animation( GtkWidgetPrivate *priv ) | ||
613 | +{ | ||
614 | + GTimeVal time; | ||
615 | + if( priv->anim ) | ||
616 | + { | ||
617 | + g_get_current_time( &time ); | ||
618 | + priv->iter = gdk_pixbuf_animation_get_iter( priv->anim, &time ); | ||
619 | + priv->interval = gdk_pixbuf_animation_iter_get_delay_time( priv->iter ); | ||
620 | + } | ||
621 | +} | ||
622 | + | ||
623 | +static void | ||
624 | +timeout_tap_and_hold_animation( GtkWidgetPrivate *priv ) | ||
625 | +{ | ||
626 | + GdkScreen *screen; | ||
627 | + GdkPixbuf *pic; | ||
628 | + GdkCursor *cursor; | ||
629 | + GTimeVal time; | ||
630 | + | ||
631 | + if( priv->anim ) | ||
632 | + { | ||
633 | + screen = gdk_screen_get_default(); | ||
634 | + g_get_current_time( &time ); | ||
635 | + | ||
636 | + pic = gdk_pixbuf_animation_iter_get_pixbuf( priv->iter ); | ||
637 | + cursor = gdk_cursor_new_from_pixbuf( gdk_display_get_default(), pic, | ||
638 | + priv->width, priv->height ); | ||
639 | + | ||
640 | + gdk_window_set_cursor( priv->fake_event->button.window, cursor ); | ||
641 | + | ||
642 | + gdk_pixbuf_animation_iter_advance( priv->iter, &time ); | ||
643 | + } | ||
644 | +} | ||
645 | + | ||
646 | +static void | ||
647 | +stop_tap_and_hold_animation( GtkWidgetPrivate *priv ) | ||
648 | +{ | ||
649 | + if( priv->anim ) | ||
650 | + { | ||
651 | + gdk_window_set_cursor( priv->fake_event->button.window, NULL ); | ||
652 | + } | ||
653 | +} | ||
654 | + | ||
655 | + | ||
656 | +#endif | ||
657 | + | ||
658 | +void tap_and_hold_remove_timer( GtkWidgetPrivate *priv ) | ||
659 | +{ | ||
660 | + if (priv->timer_id) | ||
661 | + { | ||
662 | + g_source_remove (priv->timer_id); | ||
663 | + priv->timer_id = 0; | ||
664 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
665 | + stop_tap_and_hold_animation( priv ); | ||
666 | + #endif | ||
667 | + } | ||
668 | +} | ||
669 | + | ||
670 | +/** | ||
671 | + * gtk_widget_tap_and_hold_setup: | ||
672 | + * | ||
673 | + * @widget : A @GtkWidget | ||
674 | + * @menu : A @GtkWidget | ||
675 | + * @func : A @GtkCallback | ||
676 | + * @flags : A @GtkWidgetTapAndHoldFlags | ||
677 | + * | ||
678 | + * Setups the tap and hold functionality to the @widget. | ||
679 | + * The @menu is shown when the functionality is activated. | ||
680 | + * If the @menu is wanted to be positioned in a different way than the | ||
681 | + * gtk+ default, the menuposition @func can be passed as a third parameter. | ||
682 | + * Fourth parameter, @flags are explaned with detail in the documentation. | ||
683 | + */ | ||
684 | +void gtk_widget_tap_and_hold_setup (GtkWidget *widget, GtkWidget *menu, | ||
685 | + GtkCallback func, GtkWidgetTapAndHoldFlags flags) | ||
686 | +{ | ||
687 | + /*GtkWidgetClass *klass = GTK_WIDGET_GET_CLASS(widget);*/ | ||
688 | + g_return_if_fail( GTK_IS_WIDGET(widget)); | ||
689 | + g_return_if_fail(menu == NULL || GTK_IS_MENU(menu)); | ||
690 | + g_signal_emit( widget, widget_signals[TAP_AND_HOLD_SETUP], 0, menu, func, | ||
691 | + flags ); | ||
692 | +} | ||
693 | + | ||
694 | +static void gtk_widget_tap_and_hold_setup_real (GtkWidget *widget, | ||
695 | + GtkWidget *menu, GtkCallback func, GtkWidgetTapAndHoldFlags flags) | ||
696 | +{ | ||
697 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
698 | + GtkStyle *style = NULL; | ||
699 | + GError *error = NULL; | ||
700 | + #endif | ||
701 | + GtkWidgetPrivate *priv; | ||
702 | + g_return_if_fail (GTK_IS_WIDGET(widget)); | ||
703 | + g_return_if_fail (menu == NULL || GTK_IS_MENU(menu)); | ||
704 | + priv = GTK_WIDGET_GET_PRIVATE (widget); | ||
705 | + | ||
706 | + if (priv->signals_connected) | ||
707 | + return; | ||
708 | + | ||
709 | + _gtk_menu_enable_context_menu_behavior (menu); | ||
710 | + | ||
711 | + priv->menu = menu; | ||
712 | + priv->func = (GtkMenuPositionFunc)func; | ||
713 | + priv->signals_connected = TRUE; | ||
714 | + priv->timer_counter = 0; | ||
715 | + priv->flags = flags; | ||
716 | + | ||
717 | + if (flags & GTK_TAP_AND_HOLD_PASS_PRESS) | ||
718 | + { | ||
719 | + g_signal_connect( widget, "button-press-event", | ||
720 | + G_CALLBACK(gtk_widget_tap_and_hold_button_press_with_events), priv ); | ||
721 | + g_signal_connect( widget, "button-release-event", | ||
722 | + G_CALLBACK(gtk_widget_tap_and_hold_button_release_with_events), priv ); | ||
723 | + g_signal_connect( widget, "leave-notify-event", | ||
724 | + G_CALLBACK(gtk_widget_tap_and_hold_leave_notify_with_events), priv ); | ||
725 | + } | ||
726 | + else | ||
727 | + { | ||
728 | + g_signal_connect( widget, "button-press-event", | ||
729 | + G_CALLBACK(gtk_widget_tap_and_hold_button_press), priv ); | ||
730 | + g_signal_connect( widget, "button-release-event", | ||
731 | + G_CALLBACK(gtk_widget_tap_and_hold_button_release), priv ); | ||
732 | + g_signal_connect( widget, "leave-notify-event", | ||
733 | + G_CALLBACK(gtk_widget_tap_and_hold_leave_notify), priv ); | ||
734 | + } | ||
735 | + | ||
736 | +#ifdef TAP_AND_HOLD_ANIMATION | ||
737 | + priv->anim = NULL; | ||
738 | + style = gtk_rc_get_style_by_paths(gtk_settings_get_default(), | ||
739 | + "gtk-tap-and-hold-animation", | ||
740 | + NULL, G_TYPE_NONE); | ||
741 | + | ||
742 | + if( style ) | ||
743 | + { | ||
744 | + | ||
745 | + priv->anim = gdk_pixbuf_animation_new_from_file( | ||
746 | + (gchar*)style->rc_style->bg_pixmap_name[0], &error ); | ||
747 | + | ||
748 | + priv->width = gdk_pixbuf_animation_get_width( priv->anim )/2; | ||
749 | + priv->height = gdk_pixbuf_animation_get_height( priv->anim )/2; | ||
750 | + } | ||
751 | +#endif | ||
752 | +} | ||
753 | + | ||
754 | +static void gtk_widget_real_tap_and_hold(GtkWidget *widget) | ||
755 | +{ | ||
756 | + GtkWidgetPrivate *priv = GTK_WIDGET_GET_PRIVATE (widget); | ||
757 | + | ||
758 | + if (GTK_IS_MENU(priv->menu)) | ||
759 | + gtk_menu_popup( GTK_MENU(priv->menu), NULL, NULL, | ||
760 | + (GtkMenuPositionFunc)priv->func, | ||
761 | + widget, 1, gdk_x11_get_server_time(widget->window) ); | ||
762 | +} | ||
763 | + | ||
764 | +static gboolean gtk_widget_tap_and_hold_timeout (GtkWidget *widget) | ||
765 | +{ | ||
766 | + GtkWidgetPrivate *priv= GTK_WIDGET_GET_PRIVATE(widget); | ||
767 | + gboolean return_value; | ||
768 | + gint x = 0, y = 0; | ||
769 | + | ||
770 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
771 | + timeout_tap_and_hold_animation( priv ); | ||
772 | + #endif | ||
773 | + | ||
774 | + if( priv->timer_counter ) | ||
775 | + priv->timer_counter--; | ||
776 | + else | ||
777 | + priv->timer_id = 0; | ||
778 | + | ||
779 | + gdk_display_get_pointer( gdk_x11_lookup_xdisplay( | ||
780 | + GDK_WINDOW_XDISPLAY(priv->fake_event->button.window) ), | ||
781 | + NULL, &x, &y, NULL ); | ||
782 | + | ||
783 | + if ((abs(x - priv->x) > GTK_TAP_THRESHOLD) || | ||
784 | + (abs(y - priv->y) > GTK_TAP_THRESHOLD)) | ||
785 | + { | ||
786 | + if (priv->stype != priv->type_on_press) | ||
787 | + gtk_widget_set_state( widget, priv->stype ); | ||
788 | + priv->timer_counter = 0; | ||
789 | + priv->timer_id = 0; | ||
790 | + priv->x = priv->y = 0; | ||
791 | + priv->run_press = FALSE; | ||
792 | + g_signal_emit_by_name (G_OBJECT(widget), "button-press-event", | ||
793 | + priv->fake_event, &return_value); | ||
794 | + return FALSE; | ||
795 | + } | ||
796 | + if (!priv->timer_id) | ||
797 | + { | ||
798 | + if (priv->stype != priv->type_on_press) | ||
799 | + gtk_widget_set_state( widget, priv->stype ); | ||
800 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
801 | + stop_tap_and_hold_animation( priv ); | ||
802 | + #endif | ||
803 | + g_signal_emit(widget, widget_signals[TAP_AND_HOLD], 0); | ||
804 | + priv->x = x; | ||
805 | + priv->y = y; | ||
806 | + return FALSE; | ||
807 | + } | ||
808 | + return TRUE; | ||
809 | +} | ||
810 | + | ||
811 | +static gboolean gtk_widget_tap_and_hold_button_press (GtkWidget *widget, | ||
812 | + GdkEvent *event, GtkWidgetPrivate *priv) | ||
813 | +{ | ||
814 | + if (!priv->run_press || event->button.button != 1) | ||
815 | + { | ||
816 | + priv->run_press = TRUE; | ||
817 | + return FALSE; | ||
818 | + } | ||
819 | + | ||
820 | + if (event->button.type == GDK_2BUTTON_PRESS) | ||
821 | + return FALSE; | ||
822 | + | ||
823 | + if (priv->fake_event) | ||
824 | + gdk_event_free (priv->fake_event); | ||
825 | + priv->fake_event = gdk_event_copy(event); | ||
826 | + | ||
827 | + if (!priv->timer_id) | ||
828 | + { | ||
829 | + priv->stype = GTK_WIDGET_STATE(widget); | ||
830 | + if (priv->stype != priv->type_on_press) | ||
831 | + gtk_widget_set_state( widget, priv->type_on_press ); | ||
832 | + gdk_display_get_pointer( | ||
833 | + gdk_x11_lookup_xdisplay( GDK_WINDOW_XDISPLAY(event->button.window) ), | ||
834 | + NULL, &priv->x, &priv->y, NULL ); | ||
835 | + priv->timer_counter = GTK_TAP_AND_HOLD_TIMER_COUNTER; | ||
836 | + | ||
837 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
838 | + init_tap_and_hold_animation( priv ); | ||
839 | + #endif | ||
840 | + priv->timer_id = g_timeout_add( priv->interval, | ||
841 | + (GSourceFunc)gtk_widget_tap_and_hold_timeout, widget ); | ||
842 | + } | ||
843 | +return TRUE; | ||
844 | +} | ||
845 | + | ||
846 | +static gboolean gtk_widget_tap_and_hold_button_release (GtkWidget *widget, | ||
847 | + GdkEvent *event, GtkWidgetPrivate *priv) | ||
848 | +{ | ||
849 | + gboolean return_value; | ||
850 | + | ||
851 | + if (!priv->run_press || event->button.button != 1 || !priv->timer_id || | ||
852 | + event->button.type == GDK_2BUTTON_PRESS) | ||
853 | + return FALSE; | ||
854 | + | ||
855 | + g_source_remove (priv->timer_id); | ||
856 | + priv->timer_id = 0; | ||
857 | + priv->x = priv->y = priv->timer_counter = 0; | ||
858 | + if (priv->stype != priv->type_on_press) | ||
859 | + gtk_widget_set_state (widget, priv->stype); | ||
860 | + | ||
861 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
862 | + stop_tap_and_hold_animation( priv ); | ||
863 | + #endif | ||
864 | + | ||
865 | + if (priv->flags & GTK_TAP_AND_HOLD_NO_SIGNALS) | ||
866 | + return FALSE; | ||
867 | + | ||
868 | + priv->run_press = FALSE; | ||
869 | + | ||
870 | + g_signal_emit_by_name (G_OBJECT(widget), "button-press-event", | ||
871 | + priv->fake_event, &return_value); | ||
872 | + | ||
873 | +return FALSE; | ||
874 | +} | ||
875 | + | ||
876 | +static gboolean gtk_widget_tap_and_hold_leave_notify (GtkWidget *widget, | ||
877 | + GdkEvent *event, GtkWidgetPrivate *priv) | ||
878 | +{ | ||
879 | + gboolean return_value; | ||
880 | + if (!priv->timer_id) | ||
881 | + return FALSE; | ||
882 | + | ||
883 | + g_source_remove (priv->timer_id); | ||
884 | + priv->timer_id = 0; | ||
885 | + priv->x = priv->y = priv->timer_counter = 0; | ||
886 | + if (priv->stype != priv->type_on_press) | ||
887 | + gtk_widget_set_state (widget, priv->stype); | ||
888 | + | ||
889 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
890 | + stop_tap_and_hold_animation( priv ); | ||
891 | + #endif | ||
892 | + priv->run_press = FALSE; | ||
893 | + g_signal_emit_by_name (G_OBJECT(widget), "button-press-event", | ||
894 | + priv->fake_event, &return_value); | ||
895 | + | ||
896 | +return FALSE; | ||
897 | +} | ||
898 | + | ||
899 | +static gboolean | ||
900 | +gtk_widget_tap_and_hold_timeout_with_events (GtkWidget *widget) | ||
901 | +{ | ||
902 | + gint x, y; | ||
903 | + GtkWidgetPrivate *priv= GTK_WIDGET_GET_PRIVATE(widget); | ||
904 | + | ||
905 | + g_return_val_if_fail (priv->fake_event, FALSE); | ||
906 | + | ||
907 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
908 | + timeout_tap_and_hold_animation( priv ); | ||
909 | + #endif | ||
910 | + | ||
911 | + gdk_display_get_pointer( gdk_x11_lookup_xdisplay( | ||
912 | + GDK_WINDOW_XDISPLAY(priv->fake_event->button.window) ), | ||
913 | + NULL, &x, &y, NULL ); | ||
914 | + | ||
915 | + if( priv->timer_counter ) | ||
916 | + { | ||
917 | + priv->timer_counter--; | ||
918 | + if ((abs(x - priv->x) > GTK_TAP_THRESHOLD) || | ||
919 | + (abs(y - priv->y) > GTK_TAP_THRESHOLD)) | ||
920 | + { | ||
921 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
922 | + stop_tap_and_hold_animation( priv ); | ||
923 | + #endif | ||
924 | + tap_and_hold_remove_timer( priv ); | ||
925 | + } | ||
926 | + return TRUE; | ||
927 | + } | ||
928 | + | ||
929 | + if (!((abs(x - priv->x) > GTK_TAP_THRESHOLD) || | ||
930 | + (abs(y - priv->y) > GTK_TAP_THRESHOLD))) | ||
931 | + { | ||
932 | + gboolean return_value; | ||
933 | + priv->fake_event->button.type = GDK_BUTTON_RELEASE; | ||
934 | + priv->fake_event->button.x = x; | ||
935 | + priv->fake_event->button.y = y; | ||
936 | + g_signal_emit_by_name (G_OBJECT(widget), "button-release-event", | ||
937 | + priv->fake_event, &return_value); | ||
938 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
939 | + stop_tap_and_hold_animation( priv ); | ||
940 | + #endif | ||
941 | + g_signal_emit(widget, widget_signals[TAP_AND_HOLD], 0); | ||
942 | + priv->timer_id = 0; | ||
943 | + priv->x = x; | ||
944 | + priv->y = y; | ||
945 | + gdk_event_free(priv->fake_event); | ||
946 | + priv->fake_event = NULL; | ||
947 | + } | ||
948 | + | ||
949 | + | ||
950 | + if (priv->timer_id) | ||
951 | + { | ||
952 | + g_source_remove (priv->timer_id); | ||
953 | + priv->timer_id = 0; | ||
954 | + } | ||
955 | + | ||
956 | + return FALSE; | ||
957 | +} | ||
958 | + | ||
959 | +static gboolean gtk_widget_tap_and_hold_button_press_with_events( | ||
960 | + GtkWidget *widget, GdkEvent *event, GtkWidgetPrivate *priv) | ||
961 | +{ | ||
962 | + if( priv->timer_id || event->button.type == GDK_2BUTTON_PRESS) | ||
963 | + return FALSE; | ||
964 | + | ||
965 | + if (priv->fake_event) | ||
966 | + gdk_event_free (priv->fake_event); | ||
967 | + priv->fake_event = gdk_event_copy (event); | ||
968 | + | ||
969 | + gdk_display_get_pointer( | ||
970 | + gdk_x11_lookup_xdisplay(GDK_WINDOW_XDISPLAY(event->button.window)), | ||
971 | + NULL, &priv->x, &priv->y, NULL); | ||
972 | + #ifdef TAP_AND_HOLD_ANIMATION | ||
973 | + init_tap_and_hold_animation( priv ); | ||
974 | + #endif | ||
975 | + priv->timer_counter = GTK_TAP_AND_HOLD_TIMER_COUNTER; | ||
976 | + priv->timer_id = g_timeout_add(priv->interval, | ||
977 | + (GSourceFunc)gtk_widget_tap_and_hold_timeout_with_events, | ||
978 | + widget); | ||
979 | + return FALSE; | ||
980 | +} | ||
981 | + | ||
982 | +static gboolean gtk_widget_tap_and_hold_button_release_with_events( | ||
983 | + GtkWidget *widget, GdkEvent *event, GtkWidgetPrivate *priv) | ||
984 | +{ | ||
985 | + tap_and_hold_remove_timer( priv ); | ||
986 | + return FALSE; | ||
987 | +} | ||
988 | + | ||
989 | +static gboolean gtk_widget_tap_and_hold_leave_notify_with_events( | ||
990 | + GtkWidget *widget, GdkEvent *event, GtkWidgetPrivate *priv) | ||
991 | +{ | ||
992 | + tap_and_hold_remove_timer( priv ); | ||
993 | + return FALSE; | ||
994 | +} | ||
995 | + | ||
996 | +/** | ||
997 | + * gtk_widget_tap_and_hold_menu_position_top: | ||
998 | + * @menu: a #GtkMenu | ||
999 | + * @x: x cordinate to be returned | ||
1000 | + * @y: y cordinate to be returned | ||
1001 | + * @push_in: If going off screen, push it pack on the screen | ||
1002 | + * @widget: a #GtkWidget | ||
1003 | + * | ||
1004 | + * Pre-made menu positioning function. | ||
1005 | + * It positiones the @menu over the @widget. | ||
1006 | + * | ||
1007 | + **/ | ||
1008 | +void gtk_widget_tap_and_hold_menu_position_top( GtkWidget *menu, | ||
1009 | + gint *x, gint *y, gboolean *push_in, GtkWidget *widget ) | ||
1010 | +{ | ||
1011 | + /* | ||
1012 | + * This function positiones the menu above widgets. | ||
1013 | + * This is a modified version of the position function | ||
1014 | + * gtk_combo_box_position_over. | ||
1015 | + */ | ||
1016 | + GtkWidget *topw; | ||
1017 | + GtkRequisition requisition; | ||
1018 | + gint screen_width = 0; | ||
1019 | + gint menu_xpos = 0; | ||
1020 | + gint menu_ypos = 0; | ||
1021 | + gint w_xpos = 0, w_ypos = 0; | ||
1022 | + | ||
1023 | + gtk_widget_size_request( menu, &requisition ); | ||
1024 | + | ||
1025 | + topw = gtk_widget_get_toplevel(widget); | ||
1026 | + gdk_window_get_origin( topw->window, &w_xpos, &w_ypos ); | ||
1027 | + | ||
1028 | + menu_xpos += widget->allocation.x + w_xpos; | ||
1029 | + menu_ypos += widget->allocation.y + w_ypos - requisition.height; | ||
1030 | + | ||
1031 | + if( gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL ) | ||
1032 | + menu_xpos = menu_xpos + widget->allocation.width - requisition.width; | ||
1033 | + | ||
1034 | + screen_width = gdk_screen_get_width( gtk_widget_get_screen(widget) ); | ||
1035 | + | ||
1036 | + if( menu_xpos < w_xpos ) | ||
1037 | + menu_xpos = w_xpos; | ||
1038 | + else if( (menu_xpos + requisition.width) > screen_width ) | ||
1039 | + menu_xpos -= ( (menu_xpos + requisition.width) - screen_width ); | ||
1040 | + if( menu_ypos < w_ypos ) | ||
1041 | + menu_ypos = w_ypos; | ||
1042 | + | ||
1043 | + *x = menu_xpos; | ||
1044 | + *y = menu_ypos; | ||
1045 | + *push_in = TRUE; | ||
1046 | +} | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwidget.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwidget.h.diff deleted file mode 100644 index 7350082d3c..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwidget.h.diff +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkwidget.h 2004-11-28 09:02:27.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkwidget.h 2005-04-06 16:19:38.400700568 +0300 | ||
3 | @@ -22,6 +22,9 @@ | ||
4 | * file for a list of people on the GTK+ Team. See the ChangeLog | ||
5 | * files for a list of changes. These files are distributed with | ||
6 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
7 | + | ||
8 | + * Changes made to create Hildon focus handling and the tap and hold functionality | ||
9 | + * | ||
10 | */ | ||
11 | |||
12 | #ifndef __GTK_WIDGET_H__ | ||
13 | @@ -87,6 +90,15 @@ | ||
14 | GTK_WIDGET_HELP_WHATS_THIS | ||
15 | } GtkWidgetHelpType; | ||
16 | |||
17 | +/*Tap And Hold type flags*/ | ||
18 | +typedef enum | ||
19 | +{ | ||
20 | + GTK_TAP_AND_HOLD_NONE = 0, | ||
21 | + GTK_TAP_AND_HOLD_PASS_PRESS = 1 << 0, | ||
22 | + GTK_TAP_AND_HOLD_NO_SIGNALS = 1 << 1, | ||
23 | + GTK_TAP_AND_HOLD_NO_INTERNALS = 1 << 2 | ||
24 | +} GtkWidgetTapAndHoldFlags; | ||
25 | + | ||
26 | /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer. | ||
27 | * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET. | ||
28 | */ | ||
29 | @@ -410,9 +422,10 @@ | ||
30 | void (*_gtk_reserved2) (void); | ||
31 | void (*_gtk_reserved3) (void); | ||
32 | void (*_gtk_reserved4) (void); | ||
33 | - void (*_gtk_reserved5) (void); | ||
34 | - void (*_gtk_reserved6) (void); | ||
35 | - void (*_gtk_reserved7) (void); | ||
36 | + void (*tap_and_hold) (GtkWidget *widget); /* Tap and hold action */ | ||
37 | + void (*tap_and_hold_setup) (GtkWidget *widget, GtkWidget *menu, | ||
38 | + GtkCallback func, GtkWidgetTapAndHoldFlags flags); | ||
39 | + void (*insensitive_press) (GtkWidget *widget); | ||
40 | }; | ||
41 | |||
42 | struct _GtkWidgetAuxInfo | ||
43 | @@ -787,6 +800,16 @@ | ||
44 | |||
45 | GdkColormap* _gtk_widget_peek_colormap (void); | ||
46 | |||
47 | +/*Hildon functions for focus handling*/ | ||
48 | +void gtk_widget_set_hildon_focus_handling( GtkWidget *widget, gboolean hildon_like ); | ||
49 | +gboolean gtk_widget_get_hildon_focus_handling( GtkWidget *widget ); | ||
50 | + | ||
51 | +/*Tap And Hold functions*/ | ||
52 | +void gtk_widget_tap_and_hold_menu_position_top (GtkWidget *menu, | ||
53 | + gint *x, gint *y, gboolean *push_in, GtkWidget *widget); | ||
54 | +void gtk_widget_tap_and_hold_setup (GtkWidget *widget, GtkWidget *menu, | ||
55 | + GtkCallback func, GtkWidgetTapAndHoldFlags flags); | ||
56 | + | ||
57 | #ifdef __cplusplus | ||
58 | } | ||
59 | #endif /* __cplusplus */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwindow.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwindow.c.diff deleted file mode 100644 index a67feac810..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwindow.c.diff +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkwindow.c 2005-02-21 06:21:49.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkwindow.c 2005-04-06 16:19:38.407699504 +0300 | ||
3 | @@ -166,6 +166,7 @@ | ||
4 | guint skips_taskbar : 1; | ||
5 | guint skips_pager : 1; | ||
6 | guint accept_focus : 1; | ||
7 | + GtkWidget *prev_focus_widget; | ||
8 | guint focus_on_map : 1; | ||
9 | }; | ||
10 | |||
11 | @@ -293,6 +294,9 @@ | ||
12 | GValue *value, | ||
13 | GParamSpec *pspec); | ||
14 | |||
15 | +static void gtk_window_focus_weak_notify (GtkWindow *window, | ||
16 | + GtkWidget *widget); | ||
17 | +static void gtk_window_weak_notify(GtkWidget *widget, GtkWindow *window); | ||
18 | |||
19 | GType | ||
20 | gtk_window_get_type (void) | ||
21 | @@ -771,6 +775,7 @@ | ||
22 | window->decorated = TRUE; | ||
23 | window->mnemonic_modifier = GDK_MOD1_MASK; | ||
24 | window->screen = gdk_screen_get_default (); | ||
25 | + priv->prev_focus_widget = NULL; | ||
26 | |||
27 | priv->accept_focus = TRUE; | ||
28 | priv->focus_on_map = TRUE; | ||
29 | @@ -7505,3 +7510,49 @@ | ||
30 | } | ||
31 | |||
32 | #endif | ||
33 | + | ||
34 | +/*Hildon focus handling*/ | ||
35 | +GtkWidget *gtk_window_get_prev_focus_widget( GtkWindow *window ) | ||
36 | +{ | ||
37 | + g_return_val_if_fail( GTK_IS_WINDOW(window), NULL ); | ||
38 | + return GTK_WINDOW_GET_PRIVATE(window)->prev_focus_widget; | ||
39 | +} | ||
40 | + | ||
41 | +static void gtk_window_weak_notify(GtkWidget *widget, GtkWindow *window) | ||
42 | +{ | ||
43 | + GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE(window); | ||
44 | + if (priv->prev_focus_widget == widget) | ||
45 | + g_object_weak_unref(G_OBJECT(widget), | ||
46 | + (GWeakNotify)gtk_window_focus_weak_notify, | ||
47 | + (gpointer)window); | ||
48 | +} | ||
49 | + | ||
50 | +void gtk_window_set_prev_focus_widget( GtkWindow *window, GtkWidget *widget ) | ||
51 | +{ | ||
52 | + GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE(window); | ||
53 | + g_return_if_fail(GTK_IS_WINDOW(window)); | ||
54 | + g_return_if_fail(GTK_IS_WIDGET(widget)); | ||
55 | + | ||
56 | + if (priv->prev_focus_widget) | ||
57 | + { | ||
58 | + g_object_weak_unref(G_OBJECT(window), (GWeakNotify)gtk_window_weak_notify, | ||
59 | + (gpointer)priv->prev_focus_widget); | ||
60 | + g_object_weak_unref(G_OBJECT(priv->prev_focus_widget), | ||
61 | + (GWeakNotify)gtk_window_focus_weak_notify, | ||
62 | + (gpointer)window); | ||
63 | + } | ||
64 | + | ||
65 | + priv->prev_focus_widget = widget; | ||
66 | + | ||
67 | + g_object_weak_ref(G_OBJECT(window), (GWeakNotify)gtk_window_weak_notify, | ||
68 | + (gpointer)widget); | ||
69 | + g_object_weak_ref(G_OBJECT(widget), (GWeakNotify)gtk_window_focus_weak_notify, | ||
70 | + (gpointer)window); | ||
71 | +} | ||
72 | + | ||
73 | +static void gtk_window_focus_weak_notify(GtkWindow *window, GtkWidget *widget) | ||
74 | +{ | ||
75 | + GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE(window); | ||
76 | + priv->prev_focus_widget = window->focus_widget; | ||
77 | +} | ||
78 | + | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwindow.h.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwindow.h.diff deleted file mode 100644 index 99fb70b1e7..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtkwindow.h.diff +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gtk/gtkwindow.h 2004-12-12 23:09:13.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gtk/gtkwindow.h 2005-04-06 16:19:38.408699352 +0300 | ||
3 | @@ -413,6 +413,10 @@ | ||
4 | guint accel_key, | ||
5 | GdkModifierType accel_mods); | ||
6 | |||
7 | +GtkWidget *gtk_window_get_prev_focus_widget( GtkWindow *window ); | ||
8 | +void gtk_window_set_prev_focus_widget( GtkWindow *window, GtkWidget *widget ); | ||
9 | + | ||
10 | + | ||
11 | #ifdef __cplusplus | ||
12 | } | ||
13 | #endif /* __cplusplus */ | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/hardcoded_libtool.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/hardcoded_libtool.patch deleted file mode 100644 index b2afddcc61..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/hardcoded_libtool.patch +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | --- gtk+-2.6.0/configure.in.old 2005-01-01 16:23:45.000000000 +0000 | ||
2 | +++ gtk+-2.6.0/configure.in 2005-01-01 16:24:03.000000000 +0000 | ||
3 | @@ -360,7 +360,7 @@ | ||
4 | AC_MSG_CHECKING([Whether to write dependencies into .pc files]) | ||
5 | case $enable_explicit_deps in | ||
6 | auto) | ||
7 | - deplib_check_method=`(./libtool --config; echo eval echo \\$deplib_check_method) | sh` | ||
8 | + deplib_check_method=`($host_alias-libtool --config; echo eval echo \\$deplib_check_method) | sh` | ||
9 | if test "X$deplib_check_method" = Xnone || test "x$enable_static" = xyes ; then | ||
10 | enable_explicit_deps=yes | ||
11 | else | ||
12 | @@ -688,7 +688,7 @@ | ||
13 | dnl Now we check to see if our libtool supports shared lib deps | ||
14 | dnl (in a rather ugly way even) | ||
15 | if $dynworks; then | ||
16 | - pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config" | ||
17 | + pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} $host_alias-libtool --config" | ||
18 | pixbuf_deplibs_check=`$pixbuf_libtool_config | \ | ||
19 | grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \ | ||
20 | sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'` | ||
21 | @@ -1512,7 +1512,7 @@ | ||
22 | # | ||
23 | # We are using gmodule-no-export now, but I'm leaving the stripping | ||
24 | # code in place for now, since pango and atk still require gmodule. | ||
25 | -export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` | ||
26 | +export_dynamic=`($host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` | ||
27 | if test -n "$export_dynamic"; then | ||
28 | GDK_PIXBUF_DEP_LIBS=`echo $GDK_PIXBUF_DEP_LIBS | sed -e "s/$export_dynamic//"` | ||
29 | GDK_PIXBUF_XLIB_DEP_LIBS=`echo $GDK_PIXBUF_XLIB_DEP_LIBS | sed -e "s/$export_dynamic//"` | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/io-gif-animation.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/io-gif-animation.c.diff deleted file mode 100644 index d030ae30b8..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/io-gif-animation.c.diff +++ /dev/null | |||
@@ -1,108 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gdk-pixbuf/io-gif-animation.c 2003-06-27 05:38:43.000000000 +0300 | ||
2 | +++ gtk+-2.6.4/gdk-pixbuf/io-gif-animation.c 2005-04-06 16:19:35.595127080 +0300 | ||
3 | @@ -391,6 +391,11 @@ | ||
4 | |||
5 | while (tmp != NULL) { | ||
6 | GdkPixbufFrame *f = tmp->data; | ||
7 | + | ||
8 | + if (f->pixbuf == NULL) { | ||
9 | + return; | ||
10 | + } | ||
11 | + | ||
12 | gint clipped_width = MIN (gif_anim->width - f->x_offset, gdk_pixbuf_get_width (f->pixbuf)); | ||
13 | gint clipped_height = MIN (gif_anim->height - f->y_offset, gdk_pixbuf_get_height (f->pixbuf)); | ||
14 | |||
15 | @@ -414,6 +419,10 @@ | ||
16 | TRUE, | ||
17 | 8, gif_anim->width, gif_anim->height); | ||
18 | |||
19 | + if (f->composited == NULL) { | ||
20 | + return; | ||
21 | + } | ||
22 | + | ||
23 | /* alpha gets dumped if f->composited has no alpha */ | ||
24 | |||
25 | gdk_pixbuf_fill (f->composited, | ||
26 | @@ -453,9 +462,18 @@ | ||
27 | |||
28 | if (prev_frame->action == GDK_PIXBUF_FRAME_RETAIN) { | ||
29 | f->composited = gdk_pixbuf_copy (prev_frame->composited); | ||
30 | + | ||
31 | + if (f->composited == NULL) { | ||
32 | + return; | ||
33 | + } | ||
34 | |||
35 | } else if (prev_frame->action == GDK_PIXBUF_FRAME_DISPOSE) { | ||
36 | f->composited = gdk_pixbuf_copy (prev_frame->composited); | ||
37 | + | ||
38 | + if (f->composited == NULL) { | ||
39 | + return; | ||
40 | + } | ||
41 | + | ||
42 | if (prev_clipped_width > 0 && prev_clipped_height > 0) { | ||
43 | /* Clear area of previous frame to background */ | ||
44 | GdkPixbuf *area; | ||
45 | @@ -465,6 +483,10 @@ | ||
46 | prev_frame->y_offset, | ||
47 | prev_clipped_width, | ||
48 | prev_clipped_height); | ||
49 | + | ||
50 | + if (area == NULL) { | ||
51 | + return; | ||
52 | + } | ||
53 | |||
54 | gdk_pixbuf_fill (area, | ||
55 | (gif_anim->bg_red << 24) | | ||
56 | @@ -475,7 +497,13 @@ | ||
57 | } | ||
58 | } else if (prev_frame->action == GDK_PIXBUF_FRAME_REVERT) { | ||
59 | f->composited = gdk_pixbuf_copy (prev_frame->composited); | ||
60 | - if (prev_clipped_width > 0 && prev_clipped_height > 0) { | ||
61 | + | ||
62 | + if (f->composited == NULL) { | ||
63 | + return; | ||
64 | + } | ||
65 | + | ||
66 | + if (prev_frame->revert != NULL && | ||
67 | + prev_clipped_width > 0 && prev_clipped_height > 0) { | ||
68 | /* Copy in the revert frame */ | ||
69 | gdk_pixbuf_copy_area (prev_frame->revert, | ||
70 | 0, 0, | ||
71 | @@ -500,14 +528,23 @@ | ||
72 | f->y_offset, | ||
73 | clipped_width, | ||
74 | clipped_height); | ||
75 | - | ||
76 | + | ||
77 | + if (area == NULL) { | ||
78 | + return; | ||
79 | + } | ||
80 | + | ||
81 | f->revert = gdk_pixbuf_copy (area); | ||
82 | - | ||
83 | + | ||
84 | g_object_unref (area); | ||
85 | + | ||
86 | + if (f->revert == NULL) { | ||
87 | + return; | ||
88 | + } | ||
89 | } | ||
90 | } | ||
91 | |||
92 | - if (clipped_width > 0 && clipped_height > 0) { | ||
93 | + if (clipped_width > 0 && clipped_height > 0 && | ||
94 | + f->pixbuf != NULL && f->composited != NULL) { | ||
95 | /* Put current frame onto f->composited */ | ||
96 | gdk_pixbuf_composite (f->pixbuf, | ||
97 | f->composited, | ||
98 | @@ -531,10 +568,6 @@ | ||
99 | tmp = tmp->next; | ||
100 | } | ||
101 | } | ||
102 | - | ||
103 | - g_assert (frame->composited != NULL); | ||
104 | - g_assert (gdk_pixbuf_get_width (frame->composited) == gif_anim->width); | ||
105 | - g_assert (gdk_pixbuf_get_height (frame->composited) == gif_anim->height); | ||
106 | } | ||
107 | |||
108 | GdkPixbuf* | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/io-gif.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/io-gif.c.diff deleted file mode 100644 index a42d0e4ac2..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/io-gif.c.diff +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | --- gtk+-2.6.4/gdk-pixbuf/io-gif.c 2004-11-12 07:34:31.000000000 +0200 | ||
2 | +++ gtk+-2.6.4/gdk-pixbuf/io-gif.c 2005-04-06 16:19:35.597126776 +0300 | ||
3 | @@ -920,6 +920,34 @@ | ||
4 | |||
5 | gdk_pixbuf_gif_anim_frame_composite (context->animation, prev_frame); | ||
6 | |||
7 | + /* Composite failed */ | ||
8 | + if (prev_frame->composited == NULL) { | ||
9 | + GdkPixbufFrame *frame = NULL; | ||
10 | + link = g_list_first (context->animation->frames); | ||
11 | + while (link != NULL) { | ||
12 | + frame = (GdkPixbufFrame *)link->data; | ||
13 | + if (frame != NULL) { | ||
14 | + if (frame->pixbuf != NULL) | ||
15 | + g_object_unref (frame->pixbuf); | ||
16 | + if (frame->composited != NULL) | ||
17 | + g_object_unref (frame->composited); | ||
18 | + if (frame->revert != NULL) | ||
19 | + g_object_unref (frame->revert); | ||
20 | + g_free (frame); | ||
21 | + } | ||
22 | + link = link->next; | ||
23 | + } | ||
24 | + | ||
25 | + g_list_free (context->animation->frames); | ||
26 | + context->animation->frames = NULL; | ||
27 | + | ||
28 | + g_set_error (context->error, | ||
29 | + GDK_PIXBUF_ERROR, | ||
30 | + GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, | ||
31 | + _("Not enough memory to composite a frame in GIF file")); | ||
32 | + return -2; | ||
33 | + } | ||
34 | + | ||
35 | x = context->frame->x_offset; | ||
36 | y = context->frame->y_offset; | ||
37 | w = gdk_pixbuf_get_width (context->frame->pixbuf); | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/menu-deactivate.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/menu-deactivate.patch deleted file mode 100644 index 29e665fbf3..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/menu-deactivate.patch +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | --- gtk+-2.4.4/gtk/gtkmenushell.c.old Thu Aug 26 23:45:28 2004 | ||
2 | +++ gtk+-2.4.4/gtk/gtkmenushell.c Fri Aug 27 00:13:33 2004 | ||
3 | @@ -37,7 +37,7 @@ | ||
4 | #include "gtktearoffmenuitem.h" | ||
5 | #include "gtkwindow.h" | ||
6 | |||
7 | -#define MENU_SHELL_TIMEOUT 500 | ||
8 | +#define MENU_SHELL_TIMEOUT 2000 | ||
9 | |||
10 | enum { | ||
11 | DEACTIVATE, | ||
12 | @@ -156,6 +156,7 @@ | ||
13 | static GtkContainerClass *parent_class = NULL; | ||
14 | static guint menu_shell_signals[LAST_SIGNAL] = { 0 }; | ||
15 | |||
16 | +static int last_crossing_time; | ||
17 | |||
18 | GType | ||
19 | gtk_menu_shell_get_type (void) | ||
20 | @@ -418,6 +419,7 @@ | ||
21 | gtk_grab_add (GTK_WIDGET (menu_shell)); | ||
22 | menu_shell->have_grab = TRUE; | ||
23 | menu_shell->active = TRUE; | ||
24 | + last_crossing_time = 0; | ||
25 | } | ||
26 | } | ||
27 | |||
28 | @@ -545,6 +547,13 @@ | ||
29 | menu_shell->activate_time = 0; | ||
30 | deactivate = FALSE; | ||
31 | } | ||
32 | + | ||
33 | + if (last_crossing_time != 0 | ||
34 | + && ((event->time - last_crossing_time) < 500)) | ||
35 | + { | ||
36 | + last_crossing_time = 0; | ||
37 | + deactivate = FALSE; | ||
38 | + } | ||
39 | |||
40 | if (deactivate) | ||
41 | { | ||
42 | @@ -597,6 +606,8 @@ | ||
43 | if (menu_shell->active) | ||
44 | { | ||
45 | menu_item = gtk_get_event_widget ((GdkEvent*) event); | ||
46 | + | ||
47 | + last_crossing_time = event->time; | ||
48 | |||
49 | if (!menu_item || | ||
50 | (GTK_IS_MENU_ITEM (menu_item) && | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/no-demos.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/no-demos.patch deleted file mode 100644 index 2f10a30dda..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/no-demos.patch +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | --- gtk+-2.4.1/Makefile.am~ 2004-01-17 22:15:56.000000000 +0000 | ||
2 | +++ gtk+-2.4.1/Makefile.am 2004-05-08 12:25:32.000000000 +0100 | ||
3 | @@ -1,6 +1,6 @@ | ||
4 | ## Makefile.am for GTK+ | ||
5 | |||
6 | -SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests contrib | ||
7 | +SRC_SUBDIRS = gdk-pixbuf gdk gtk modules tests contrib | ||
8 | SUBDIRS = po po-properties $(SRC_SUBDIRS) docs build m4macros | ||
9 | |||
10 | # require automake 1.4 | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/no-xwc.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/no-xwc.patch deleted file mode 100644 index affb4a303e..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/no-xwc.patch +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c | ||
2 | --- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c 2004-11-30 14:57:14 +00:00 | ||
3 | +++ gtk+-2.6.0/gdk/x11/gdkdrawable-x11.c 2005-01-02 15:38:06 +00:00 | ||
4 | @@ -576,12 +576,14 @@ | ||
5 | GDK_GC_GET_XGC (gc), x, y, (XChar2b *) text, text_length / 2); | ||
6 | } | ||
7 | } | ||
8 | +#ifdef HAVE_XWC | ||
9 | else if (font->type == GDK_FONT_FONTSET) | ||
10 | { | ||
11 | XFontSet fontset = (XFontSet) GDK_FONT_XFONT (font); | ||
12 | XmbDrawString (xdisplay, impl->xid, | ||
13 | fontset, GDK_GC_GET_XGC (gc), x, y, text, text_length); | ||
14 | } | ||
15 | +#endif | ||
16 | else | ||
17 | g_error("undefined font type\n"); | ||
18 | } | ||
19 | @@ -613,6 +615,7 @@ | ||
20 | GDK_GC_GET_XGC (gc), x, y, text_8bit, text_length); | ||
21 | g_free (text_8bit); | ||
22 | } | ||
23 | +#ifdef HAVE_XWC | ||
24 | else if (font->type == GDK_FONT_FONTSET) | ||
25 | { | ||
26 | if (sizeof(GdkWChar) == sizeof(wchar_t)) | ||
27 | @@ -633,6 +636,7 @@ | ||
28 | g_free (text_wchar); | ||
29 | } | ||
30 | } | ||
31 | +#endif | ||
32 | else | ||
33 | g_error("undefined font type\n"); | ||
34 | } | ||
35 | diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkfont-x11.c gtk+-2.6.0/gdk/x11/gdkfont-x11.c | ||
36 | --- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkfont-x11.c 2004-08-26 01:23:46 +01:00 | ||
37 | +++ gtk+-2.6.0/gdk/x11/gdkfont-x11.c 2005-01-02 15:45:39 +00:00 | ||
38 | @@ -525,10 +525,12 @@ | ||
39 | width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2); | ||
40 | } | ||
41 | break; | ||
42 | +#ifdef HAVE_XWC | ||
43 | case GDK_FONT_FONTSET: | ||
44 | fontset = (XFontSet) private->xfont; | ||
45 | width = XmbTextEscapement (fontset, text, text_length); | ||
46 | break; | ||
47 | +#endif | ||
48 | default: | ||
49 | width = 0; | ||
50 | } | ||
51 | @@ -578,6 +580,7 @@ | ||
52 | width = 0; | ||
53 | } | ||
54 | break; | ||
55 | +#ifdef HAVE_XWC | ||
56 | case GDK_FONT_FONTSET: | ||
57 | if (sizeof(GdkWChar) == sizeof(wchar_t)) | ||
58 | { | ||
59 | @@ -595,6 +598,7 @@ | ||
60 | g_free (text_wchar); | ||
61 | } | ||
62 | break; | ||
63 | +#endif | ||
64 | default: | ||
65 | width = 0; | ||
66 | } | ||
67 | @@ -667,6 +671,7 @@ | ||
68 | if (descent) | ||
69 | *descent = overall.descent; | ||
70 | break; | ||
71 | +#ifdef HAVE_XWC | ||
72 | case GDK_FONT_FONTSET: | ||
73 | fontset = (XFontSet) private->xfont; | ||
74 | XmbTextExtents (fontset, text, text_length, &ink, &logical); | ||
75 | @@ -681,6 +686,7 @@ | ||
76 | if (descent) | ||
77 | *descent = ink.y + ink.height; | ||
78 | break; | ||
79 | +#endif | ||
80 | } | ||
81 | |||
82 | } | ||
83 | @@ -753,6 +759,7 @@ | ||
84 | *descent = overall.descent; | ||
85 | break; | ||
86 | } | ||
87 | +#ifdef HAVE_XWC | ||
88 | case GDK_FONT_FONTSET: | ||
89 | fontset = (XFontSet) private->xfont; | ||
90 | |||
91 | @@ -780,6 +787,7 @@ | ||
92 | if (descent) | ||
93 | *descent = ink.y + ink.height; | ||
94 | break; | ||
95 | +#endif | ||
96 | } | ||
97 | |||
98 | } | ||
99 | diff -urNd ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkim-x11.c gtk+-2.6.0/gdk/x11/gdkim-x11.c | ||
100 | --- ../gtk+-2.6.0-r2/gtk+-2.6.0/gdk/x11/gdkim-x11.c 2004-11-17 00:55:10 +00:00 | ||
101 | +++ gtk+-2.6.0/gdk/x11/gdkim-x11.c 2005-01-02 15:42:04 +00:00 | ||
102 | @@ -48,6 +48,7 @@ | ||
103 | void | ||
104 | _gdk_x11_initialize_locale (void) | ||
105 | { | ||
106 | +#ifdef HAVE_XWC | ||
107 | wchar_t result; | ||
108 | gchar *current_locale; | ||
109 | static char *last_locale = NULL; | ||
110 | @@ -93,7 +94,8 @@ | ||
111 | GDK_NOTE (XIM, | ||
112 | g_message ("%s multi-byte string functions.", | ||
113 | gdk_use_mb ? "Using" : "Not using")); | ||
114 | - | ||
115 | +#endif | ||
116 | + | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | @@ -136,6 +138,7 @@ | ||
121 | { | ||
122 | gchar *mbstr; | ||
123 | |||
124 | +#ifdef HAVE_XWC | ||
125 | if (gdk_use_mb) | ||
126 | { | ||
127 | GdkDisplay *display = find_a_display (); | ||
128 | @@ -178,6 +181,7 @@ | ||
129 | XFree (tpr.value); | ||
130 | } | ||
131 | else | ||
132 | +#endif | ||
133 | { | ||
134 | gint length = 0; | ||
135 | gint i; | ||
136 | @@ -210,6 +214,7 @@ | ||
137 | gint | ||
138 | gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max) | ||
139 | { | ||
140 | +#ifdef HAVE_XWC | ||
141 | if (gdk_use_mb) | ||
142 | { | ||
143 | GdkDisplay *display = find_a_display (); | ||
144 | @@ -242,6 +247,7 @@ | ||
145 | return len_cpy; | ||
146 | } | ||
147 | else | ||
148 | +#endif | ||
149 | { | ||
150 | gint i; | ||
151 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/scroll-timings.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/scroll-timings.patch deleted file mode 100644 index a38b21dcc2..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/scroll-timings.patch +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | --- gtk+-2.4.4/gtk/gtkrange.c~ 2004-08-23 01:50:22.000000000 +0100 | ||
2 | +++ gtk+-2.4.4/gtk/gtkrange.c 2004-08-27 15:48:49.000000000 +0100 | ||
3 | @@ -35,9 +35,9 @@ | ||
4 | #include "gtkintl.h" | ||
5 | #include "gtkscrollbar.h" | ||
6 | |||
7 | -#define SCROLL_INITIAL_DELAY 250 /* must hold button this long before ... */ | ||
8 | -#define SCROLL_LATER_DELAY 100 /* ... it starts repeating at this rate */ | ||
9 | -#define UPDATE_DELAY 300 /* Delay for queued update */ | ||
10 | +#define SCROLL_INITIAL_DELAY 500 /* must hold button this long before ... */ | ||
11 | +#define SCROLL_LATER_DELAY 200 /* ... it starts repeating at this rate */ | ||
12 | +#define UPDATE_DELAY 1000 /* Delay for queued update */ | ||
13 | |||
14 | enum { | ||
15 | PROP_0, | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/single-click.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/single-click.patch deleted file mode 100644 index 3bb208d4d6..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/single-click.patch +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | diff -urNd ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkcalendar.c gtk+-2.6.3/gtk/gtkcalendar.c | ||
2 | --- ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkcalendar.c 2005-04-06 16:57:04 +01:00 | ||
3 | +++ gtk+-2.6.3/gtk/gtkcalendar.c 2005-04-06 20:05:18 +01:00 | ||
4 | @@ -1023,9 +1023,11 @@ | ||
5 | } | ||
6 | |||
7 | gtk_calendar_select_and_focus_day (calendar, day); | ||
8 | - } | ||
9 | + | ||
10 | + // This change causes the calendar to disappear after choosing a day | ||
11 | +/* } | ||
12 | else if (event->type == GDK_2BUTTON_PRESS) | ||
13 | - { | ||
14 | + {*/ | ||
15 | private_data->in_drag = 0; | ||
16 | if (day_month == MONTH_CURRENT) | ||
17 | g_signal_emit (calendar, | ||
18 | diff -urNd ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkfilesel.c gtk+-2.6.3/gtk/gtkfilesel.c | ||
19 | --- ../gtk+-2.6.3-r0.old/gtk+-2.6.3/gtk/gtkfilesel.c 2005-04-06 16:57:07 +01:00 | ||
20 | +++ gtk+-2.6.3/gtk/gtkfilesel.c 2005-04-07 13:40:32 +01:00 | ||
21 | @@ -2468,6 +2468,33 @@ | ||
22 | if (fs->last_selected != NULL) | ||
23 | g_free (fs->last_selected); | ||
24 | |||
25 | + // Single-click directory entry | ||
26 | + if (new_names->len == 1) | ||
27 | + { | ||
28 | + GtkTreeView *tree_view; | ||
29 | + GtkTreeModel *model; | ||
30 | + GtkTreePath *path; | ||
31 | + GtkTreeIter iter; | ||
32 | + gboolean is_file; | ||
33 | + | ||
34 | + tree_view = gtk_tree_selection_get_tree_view (selection); | ||
35 | + | ||
36 | + if (gtk_tree_selection_get_selected (selection, &model, &iter)) | ||
37 | + { | ||
38 | + path = gtk_tree_model_get_path (model, &iter); | ||
39 | + gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1); | ||
40 | + | ||
41 | + if (!is_file) | ||
42 | + { | ||
43 | + gtk_file_selection_dir_activate (tree_view, path, | ||
44 | + gtk_tree_view_get_column (tree_view, DIR_COLUMN), | ||
45 | + user_data); | ||
46 | + } | ||
47 | + | ||
48 | + gtk_tree_path_free (path); | ||
49 | + } | ||
50 | + } | ||
51 | + | ||
52 | fs->last_selected = g_strdup (g_ptr_array_index (new_names, index)); | ||
53 | filename = get_real_filename (fs->last_selected, FALSE); | ||
54 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/small-gtkfilesel.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/small-gtkfilesel.patch deleted file mode 100644 index 20bf4cf366..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/small-gtkfilesel.patch +++ /dev/null | |||
@@ -1,267 +0,0 @@ | |||
1 | diff -urNd ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c gtk+-2.4.4/gtk/gtkfilesel.c | ||
2 | --- ../gtk+-2.4.4-r5/gtk+-2.4.4/gtk/gtkfilesel.c 2004-07-10 05:02:10.000000000 +0100 | ||
3 | +++ gtk+-2.4.4/gtk/gtkfilesel.c 2004-09-13 13:40:09.000000000 +0100 | ||
4 | @@ -68,6 +68,7 @@ | ||
5 | #include "gtkprivate.h" | ||
6 | #include "gtkscrolledwindow.h" | ||
7 | #include "gtkstock.h" | ||
8 | +#include "gtksignal.h" | ||
9 | #include "gtktreeselection.h" | ||
10 | #include "gtktreeview.h" | ||
11 | #include "gtkvbox.h" | ||
12 | @@ -77,6 +78,7 @@ | ||
13 | #include "gtkmessagedialog.h" | ||
14 | #include "gtkdnd.h" | ||
15 | #include "gtkeventbox.h" | ||
16 | +#include "gtkimage.h" | ||
17 | |||
18 | #undef GTK_DISABLE_DEPRECATED | ||
19 | #include "gtkoptionmenu.h" | ||
20 | @@ -245,7 +247,8 @@ | ||
21 | }; | ||
22 | |||
23 | enum { | ||
24 | - DIR_COLUMN | ||
25 | + DIR_COLUMN, | ||
26 | + ISFILE_COLUMN | ||
27 | }; | ||
28 | |||
29 | enum { | ||
30 | @@ -400,6 +403,12 @@ | ||
31 | GtkTreePath *path, | ||
32 | GtkTreeViewColumn *column, | ||
33 | gpointer user_data); | ||
34 | + | ||
35 | +static void gtk_file_selection_activate (GtkTreeView *tree_view, | ||
36 | + GtkTreePath *path, | ||
37 | + GtkTreeViewColumn *column, | ||
38 | + gpointer user_data); | ||
39 | + | ||
40 | static void gtk_file_selection_file_changed (GtkTreeSelection *selection, | ||
41 | gpointer user_data); | ||
42 | static void gtk_file_selection_dir_activate (GtkTreeView *tree_view, | ||
43 | @@ -419,6 +428,7 @@ | ||
44 | static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data); | ||
45 | static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data); | ||
46 | static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data); | ||
47 | +static void gtk_file_selection_style_set (GtkWidget *widget, GtkStyle *prev_style); | ||
48 | |||
49 | static void free_selected_names (GPtrArray *names); | ||
50 | |||
51 | @@ -578,6 +588,23 @@ | ||
52 | G_PARAM_WRITABLE)); | ||
53 | object_class->destroy = gtk_file_selection_destroy; | ||
54 | widget_class->map = gtk_file_selection_map; | ||
55 | + widget_class->style_set = gtk_file_selection_style_set; | ||
56 | + | ||
57 | + gtk_widget_class_install_style_property (widget_class, | ||
58 | + g_param_spec_boolean ("show_fileops_default", | ||
59 | + _("Show fileop buttons by default"), | ||
60 | + _("Whether file operation buttons are shown by default"), | ||
61 | + TRUE, | ||
62 | + G_PARAM_READABLE)); | ||
63 | + | ||
64 | + gtk_widget_class_install_style_property (widget_class, | ||
65 | + g_param_spec_int ("border_width", | ||
66 | + _("Border width"), | ||
67 | + _("Width of border around the main dialog area"), | ||
68 | + 0, | ||
69 | + G_MAXINT, | ||
70 | + 10, | ||
71 | + G_PARAM_READABLE)); | ||
72 | } | ||
73 | |||
74 | static void gtk_file_selection_set_property (GObject *object, | ||
75 | @@ -649,7 +676,29 @@ | ||
76 | gtk_widget_grab_default (widget); | ||
77 | return FALSE; | ||
78 | } | ||
79 | - | ||
80 | + | ||
81 | +static void | ||
82 | +gtk_file_selection_style_set (GtkWidget *filesel, | ||
83 | + GtkStyle *prev_style) | ||
84 | +{ | ||
85 | + gboolean show_fileops; | ||
86 | + gint border_width; | ||
87 | + | ||
88 | + gtk_widget_style_get (filesel, | ||
89 | + "show_fileops_default", | ||
90 | + &show_fileops, | ||
91 | + "border_width", | ||
92 | + &border_width, | ||
93 | + NULL); | ||
94 | + | ||
95 | + gtk_container_set_border_width (GTK_CONTAINER (filesel), border_width); | ||
96 | + | ||
97 | + if (show_fileops) | ||
98 | + gtk_file_selection_show_fileop_buttons (GTK_FILE_SELECTION (filesel)); | ||
99 | + else | ||
100 | + gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (filesel)); | ||
101 | +} | ||
102 | + | ||
103 | static void | ||
104 | gtk_file_selection_init (GtkFileSelection *filesel) | ||
105 | { | ||
106 | @@ -674,17 +723,15 @@ | ||
107 | |||
108 | /* The dialog-sized vertical box */ | ||
109 | filesel->main_vbox = dialog->vbox; | ||
110 | - gtk_container_set_border_width (GTK_CONTAINER (filesel), 10); | ||
111 | |||
112 | /* The horizontal box containing create, rename etc. buttons */ | ||
113 | filesel->button_area = gtk_hbutton_box_new (); | ||
114 | gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START); | ||
115 | - gtk_box_set_spacing (GTK_BOX (filesel->button_area), 0); | ||
116 | gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area, | ||
117 | FALSE, FALSE, 0); | ||
118 | gtk_widget_show (filesel->button_area); | ||
119 | |||
120 | - gtk_file_selection_show_fileop_buttons (filesel); | ||
121 | + gtk_file_selection_style_set (GTK_WIDGET (filesel), NULL); | ||
122 | |||
123 | /* hbox for pulldown menu */ | ||
124 | pulldown_hbox = gtk_hbox_new (TRUE, 5); | ||
125 | @@ -723,25 +770,32 @@ | ||
126 | |||
127 | /* The directories list */ | ||
128 | |||
129 | - model = gtk_list_store_new (1, G_TYPE_STRING); | ||
130 | + model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN); /* MA */ | ||
131 | filesel->dir_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); | ||
132 | g_object_unref (model); | ||
133 | |||
134 | - column = gtk_tree_view_column_new_with_attributes (_("Folders"), | ||
135 | + column = gtk_tree_view_column_new_with_attributes (/*_("Folders")*/ NULL, | ||
136 | gtk_cell_renderer_text_new (), | ||
137 | "text", DIR_COLUMN, | ||
138 | NULL); | ||
139 | label = gtk_label_new_with_mnemonic (_("Fol_ders")); | ||
140 | gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->dir_list); | ||
141 | gtk_widget_show (label); | ||
142 | - gtk_tree_view_column_set_widget (column, label); | ||
143 | + | ||
144 | + /* gtk_tree_view_column_set_widget (column, label); */ | ||
145 | + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (filesel->dir_list), FALSE); | ||
146 | + | ||
147 | gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | ||
148 | gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->dir_list), column); | ||
149 | |||
150 | gtk_widget_set_size_request (filesel->dir_list, | ||
151 | DIR_LIST_WIDTH, DIR_LIST_HEIGHT); | ||
152 | g_signal_connect (filesel->dir_list, "row_activated", | ||
153 | - G_CALLBACK (gtk_file_selection_dir_activate), filesel); | ||
154 | + G_CALLBACK (gtk_file_selection_activate), filesel); | ||
155 | + | ||
156 | + g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->dir_list)), "changed", | ||
157 | + G_CALLBACK (gtk_file_selection_file_changed), filesel); | ||
158 | + | ||
159 | |||
160 | /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); */ | ||
161 | |||
162 | @@ -758,41 +812,6 @@ | ||
163 | gtk_widget_show (filesel->dir_list); | ||
164 | gtk_widget_show (scrolled_win); | ||
165 | |||
166 | - /* The files list */ | ||
167 | - model = gtk_list_store_new (1, G_TYPE_STRING); | ||
168 | - filesel->file_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); | ||
169 | - g_object_unref (model); | ||
170 | - | ||
171 | - column = gtk_tree_view_column_new_with_attributes (_("Files"), | ||
172 | - gtk_cell_renderer_text_new (), | ||
173 | - "text", FILE_COLUMN, | ||
174 | - NULL); | ||
175 | - label = gtk_label_new_with_mnemonic (_("_Files")); | ||
176 | - gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->file_list); | ||
177 | - gtk_widget_show (label); | ||
178 | - gtk_tree_view_column_set_widget (column, label); | ||
179 | - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); | ||
180 | - gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->file_list), column); | ||
181 | - | ||
182 | - gtk_widget_set_size_request (filesel->file_list, | ||
183 | - FILE_LIST_WIDTH, FILE_LIST_HEIGHT); | ||
184 | - g_signal_connect (filesel->file_list, "row_activated", | ||
185 | - G_CALLBACK (gtk_file_selection_file_activate), filesel); | ||
186 | - g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)), "changed", | ||
187 | - G_CALLBACK (gtk_file_selection_file_changed), filesel); | ||
188 | - | ||
189 | - /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); */ | ||
190 | - | ||
191 | - scrolled_win = gtk_scrolled_window_new (NULL, NULL); | ||
192 | - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); | ||
193 | - gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list); | ||
194 | - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), | ||
195 | - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | ||
196 | - gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0); | ||
197 | - gtk_container_add (GTK_CONTAINER (list_container), scrolled_win); | ||
198 | - gtk_widget_show (filesel->file_list); | ||
199 | - gtk_widget_show (scrolled_win); | ||
200 | - | ||
201 | /* action area for packing buttons into. */ | ||
202 | filesel->action_area = gtk_hbox_new (TRUE, 0); | ||
203 | gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area, | ||
204 | @@ -2008,6 +2027,23 @@ | ||
205 | } | ||
206 | |||
207 | static void | ||
208 | +gtk_file_selection_activate (GtkTreeView *tree_view, | ||
209 | + GtkTreePath *path, | ||
210 | + GtkTreeViewColumn *column, | ||
211 | + gpointer user_data) | ||
212 | +{ | ||
213 | + GtkTreeModel *model = gtk_tree_view_get_model (tree_view); | ||
214 | + GtkTreeIter iter; | ||
215 | + gboolean is_file; | ||
216 | + | ||
217 | + gtk_tree_model_get_iter (model, &iter, path); | ||
218 | + gtk_tree_model_get (model, &iter, ISFILE_COLUMN, &is_file, -1); | ||
219 | + | ||
220 | + if (! is_file) | ||
221 | + gtk_file_selection_dir_activate (tree_view, path, column, user_data); | ||
222 | +} | ||
223 | + | ||
224 | +static void | ||
225 | gtk_file_selection_file_activate (GtkTreeView *tree_view, | ||
226 | GtkTreePath *path, | ||
227 | GtkTreeViewColumn *column, | ||
228 | @@ -2103,7 +2139,6 @@ | ||
229 | PossibleCompletion* poss; | ||
230 | GtkTreeIter iter; | ||
231 | GtkListStore *dir_model; | ||
232 | - GtkListStore *file_model; | ||
233 | gchar* filename; | ||
234 | gchar* rem_path = rel_path; | ||
235 | gchar* sel_text; | ||
236 | @@ -2125,10 +2160,8 @@ | ||
237 | g_assert (cmpl_state->reference_dir); | ||
238 | |||
239 | dir_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->dir_list))); | ||
240 | - file_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->file_list))); | ||
241 | |||
242 | gtk_list_store_clear (dir_model); | ||
243 | - gtk_list_store_clear (file_model); | ||
244 | |||
245 | /* Set the dir list to include ./ and ../ */ | ||
246 | gtk_list_store_append (dir_model, &iter); | ||
247 | @@ -2150,13 +2183,17 @@ | ||
248 | strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0) | ||
249 | { | ||
250 | gtk_list_store_append (dir_model, &iter); | ||
251 | - gtk_list_store_set (dir_model, &iter, DIR_COLUMN, filename, -1); | ||
252 | + gtk_list_store_set (dir_model, &iter, | ||
253 | + DIR_COLUMN, filename, | ||
254 | + ISFILE_COLUMN, FALSE, -1); | ||
255 | } | ||
256 | } | ||
257 | else | ||
258 | { | ||
259 | - gtk_list_store_append (file_model, &iter); | ||
260 | - gtk_list_store_set (file_model, &iter, DIR_COLUMN, filename, -1); | ||
261 | + gtk_list_store_append (dir_model, &iter); | ||
262 | + gtk_list_store_set (dir_model, &iter, | ||
263 | + DIR_COLUMN, filename, | ||
264 | + ISFILE_COLUMN, TRUE, -1); | ||
265 | } | ||
266 | } | ||
267 | |||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/spinbutton.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/spinbutton.patch deleted file mode 100644 index 8ad7507af0..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/spinbutton.patch +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | --- gtk+-2.4.3/gtk/gtkspinbutton.c.old 2004-04-22 14:49:27.000000000 +0100 | ||
2 | +++ gtk+-2.4.3/gtk/gtkspinbutton.c 2004-06-30 21:48:18.000000000 +0100 | ||
3 | @@ -733,7 +733,7 @@ | ||
4 | |||
5 | spin = GTK_SPIN_BUTTON (widget); | ||
6 | arrow_size = spin_button_get_arrow_size (spin); | ||
7 | - panel_width = arrow_size + 2 * widget->style->xthickness; | ||
8 | + panel_width = (2 * arrow_size) + 4 * widget->style->xthickness; | ||
9 | |||
10 | widget->allocation = *allocation; | ||
11 | |||
12 | @@ -866,19 +866,16 @@ | ||
13 | { | ||
14 | width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness; | ||
15 | |||
16 | + y = widget->style->ythickness; | ||
17 | + height = widget->requisition.height - (2 * y); | ||
18 | + | ||
19 | if (arrow_type == GTK_ARROW_UP) | ||
20 | { | ||
21 | x = 0; | ||
22 | - y = 0; | ||
23 | - | ||
24 | - height = widget->requisition.height / 2; | ||
25 | } | ||
26 | else | ||
27 | { | ||
28 | - x = 0; | ||
29 | - y = widget->requisition.height / 2; | ||
30 | - | ||
31 | - height = (widget->requisition.height + 1) / 2; | ||
32 | + x = width; | ||
33 | } | ||
34 | |||
35 | if (spin_button_at_limit (spin_button, arrow_type)) | ||
36 | @@ -908,32 +905,17 @@ | ||
37 | shadow_type = GTK_SHADOW_OUT; | ||
38 | } | ||
39 | } | ||
40 | - | ||
41 | + | ||
42 | gtk_paint_box (widget->style, spin_button->panel, | ||
43 | state_type, shadow_type, | ||
44 | NULL, widget, | ||
45 | - (arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down", | ||
46 | + NULL, | ||
47 | x, y, width, height); | ||
48 | |||
49 | height = widget->requisition.height; | ||
50 | |||
51 | - if (arrow_type == GTK_ARROW_DOWN) | ||
52 | - { | ||
53 | - y = height / 2; | ||
54 | - height = height - y - 2; | ||
55 | - } | ||
56 | - else | ||
57 | - { | ||
58 | - y = 2; | ||
59 | - height = height / 2 - 2; | ||
60 | - } | ||
61 | - | ||
62 | width -= 3; | ||
63 | - | ||
64 | - if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
65 | - x = 2; | ||
66 | - else | ||
67 | - x = 1; | ||
68 | + height -= 3; | ||
69 | |||
70 | w = width / 2; | ||
71 | w -= w % 2 - 1; /* force odd */ | ||
72 | @@ -1108,7 +1090,7 @@ | ||
73 | if (GTK_ENTRY (widget)->editable) | ||
74 | gtk_spin_button_update (spin); | ||
75 | |||
76 | - if (event->y <= widget->requisition.height / 2) | ||
77 | + if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness)) | ||
78 | { | ||
79 | if (event->button == 1) | ||
80 | start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment); | ||
81 | @@ -1143,44 +1125,11 @@ | ||
82 | |||
83 | arrow_size = spin_button_get_arrow_size (spin); | ||
84 | |||
85 | - if (event->button == spin->button) | ||
86 | - { | ||
87 | - int click_child = spin->click_child; | ||
88 | + gtk_spin_button_stop_spinning (spin); | ||
89 | |||
90 | - gtk_spin_button_stop_spinning (spin); | ||
91 | - | ||
92 | - if (event->button == 3) | ||
93 | - { | ||
94 | - if (event->y >= 0 && event->x >= 0 && | ||
95 | - event->y <= widget->requisition.height && | ||
96 | - event->x <= arrow_size + 2 * widget->style->xthickness) | ||
97 | - { | ||
98 | - if (click_child == GTK_ARROW_UP && | ||
99 | - event->y <= widget->requisition.height / 2) | ||
100 | - { | ||
101 | - gdouble diff; | ||
102 | - | ||
103 | - diff = spin->adjustment->upper - spin->adjustment->value; | ||
104 | - if (diff > EPSILON) | ||
105 | - gtk_spin_button_real_spin (spin, diff); | ||
106 | - } | ||
107 | - else if (click_child == GTK_ARROW_DOWN && | ||
108 | - event->y > widget->requisition.height / 2) | ||
109 | - { | ||
110 | - gdouble diff; | ||
111 | - | ||
112 | - diff = spin->adjustment->value - spin->adjustment->lower; | ||
113 | - if (diff > EPSILON) | ||
114 | - gtk_spin_button_real_spin (spin, -diff); | ||
115 | - } | ||
116 | - } | ||
117 | - } | ||
118 | - spin_button_redraw (spin); | ||
119 | + spin_button_redraw (spin); | ||
120 | |||
121 | - return TRUE; | ||
122 | - } | ||
123 | - else | ||
124 | - return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event); | ||
125 | + return TRUE; | ||
126 | } | ||
127 | |||
128 | static gint | ||
diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/xsettings.patch b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/xsettings.patch deleted file mode 100644 index b63e262d34..0000000000 --- a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/xsettings.patch +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | --- gtk+-2.4.4/gdk/x11/gdkevents-x11.c.old Sun Aug 22 17:14:00 2004 | ||
2 | +++ gtk+-2.4.4/gdk/x11/gdkevents-x11.c Sun Aug 22 17:14:00 2004 | ||
3 | @@ -2827,10 +2827,9 @@ | ||
4 | { | ||
5 | GdkScreenX11 *screen = data; | ||
6 | |||
7 | - if (xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent)) | ||
8 | - return GDK_FILTER_REMOVE; | ||
9 | - else | ||
10 | - return GDK_FILTER_CONTINUE; | ||
11 | + xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent); | ||
12 | + | ||
13 | + return GDK_FILTER_CONTINUE; | ||
14 | } | ||
15 | |||
16 | static void | ||
diff --git a/meta/packages/gtk+/gtk+_2.6.4-1.osso7.bb b/meta/packages/gtk+/gtk+_2.6.4-1.osso7.bb deleted file mode 100644 index 6a6d560a50..0000000000 --- a/meta/packages/gtk+/gtk+_2.6.4-1.osso7.bb +++ /dev/null | |||
@@ -1,166 +0,0 @@ | |||
1 | LICENSE = "LGPL" | ||
2 | DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \ | ||
3 | set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites." | ||
4 | HOMEPAGE = "http://www.gtk.org" | ||
5 | SECTION = "libs" | ||
6 | PRIORITY = "optional" | ||
7 | DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt" | ||
8 | PR = "r1" | ||
9 | |||
10 | S = "${WORKDIR}/gtk+2.0-2.6.4/upstream/tarballs/gtk+-2.6.4/" | ||
11 | |||
12 | SRC_URI = "http://stage.maemo.org:80/pool/maemo/ossw/source/g/gtk+2.0/gtk+2.0_${PV}.tar.gz \ | ||
13 | file://no-demos.patch;patch=1 \ | ||
14 | file://no-xwc.patch;patch=1 \ | ||
15 | file://automake-lossage.patch;patch=1 \ | ||
16 | file://spinbutton.patch;patch=1 \ | ||
17 | file://hardcoded_libtool.patch;patch=1 \ | ||
18 | file://disable-tooltips.patch;patch=1 \ | ||
19 | file://gtklabel-resize-patch;patch=1 \ | ||
20 | file://xsettings.patch;patch=1 \ | ||
21 | file://scroll-timings.patch;patch=1 \ | ||
22 | file://small-gtkfilesel.patch;patch=1 \ | ||
23 | file://migration.patch;patch=1;pnum=0 \ | ||
24 | file://000_gtk+-2.0.6-exportsymbols.patch;patch=1 \ | ||
25 | file://000_gtk+-2.2.0-buildfix-immodule.patch;patch=1 \ | ||
26 | file://002_xpmico.patch;patch=1 \ | ||
27 | file://003_iconcache.patch;patch=1 \ | ||
28 | file://configure.diff;patch=1 \ | ||
29 | file://configure.in.diff;patch=1 \ | ||
30 | file://gdkwindow-x11.c.diff;patch=1 \ | ||
31 | file://gtk.h.diff;patch=1 \ | ||
32 | file://gtk_Makefile.am.diff;patch=1 \ | ||
33 | file://gtk_Makefile.in.diff;patch=1 \ | ||
34 | file://gtkalias.h.diff;patch=1 \ | ||
35 | file://gtkbutton.c.diff;patch=1 \ | ||
36 | file://gtkbutton.h.diff;patch=1 \ | ||
37 | file://gtkcalendar.c.diff;patch=1 \ | ||
38 | file://gtkcalendar.h.diff;patch=1 \ | ||
39 | file://gtkcellrenderertext.c.diff;patch=1 \ | ||
40 | file://gtkcellrenderertoggle.c.diff;patch=1 \ | ||
41 | file://gtkcellview.c.diff;patch=1 \ | ||
42 | file://gtkcellview.h.diff;patch=1 \ | ||
43 | file://gtkcheckbutton.c.diff;patch=1 \ | ||
44 | file://gtkcombobox.c.diff;patch=1 \ | ||
45 | file://gtkcomboboxentry.c.diff;patch=1 \ | ||
46 | file://gtkcontainer.c.diff;patch=1 \ | ||
47 | file://gtkdialog.c.diff;patch=1 \ | ||
48 | file://gtkdnd.c.diff;patch=1 \ | ||
49 | file://gtkentry.c.diff;patch=1 \ | ||
50 | file://gtkenums.h.diff;patch=1 \ | ||
51 | file://gtkfilesystem.c.diff;patch=1 \ | ||
52 | file://gtkfilesystem.h.diff;patch=1 \ | ||
53 | file://gtkframe.c.diff;patch=1 \ | ||
54 | file://gtkhashtable.c.diff;patch=1 \ | ||
55 | file://gtkhashtable.h.diff;patch=1 \ | ||
56 | file://gtkhbbox.c.diff;patch=1 \ | ||
57 | file://gtkhseparator.c.diff;patch=1 \ | ||
58 | file://gtkiconfactory.c.diff;patch=1 \ | ||
59 | file://gtkicontheme.c.diff;patch=1 \ | ||
60 | file://gtkimcontext.c.diff;patch=1 \ | ||
61 | file://gtkimcontext.h.diff;patch=1 \ | ||
62 | file://gtkimmulticontext.c.diff;patch=1 \ | ||
63 | file://gtklabel.c.diff;patch=1 \ | ||
64 | file://gtklabel.h.diff;patch=1 \ | ||
65 | file://gtkmain.c.diff;patch=1 \ | ||
66 | file://gtkmarshal.c.diff;patch=1 \ | ||
67 | file://gtkmarshal.h.diff;patch=1 \ | ||
68 | file://gtkmarshalers.c.diff;patch=1 \ | ||
69 | file://gtkmarshalers.h.diff;patch=1 \ | ||
70 | file://gtkmenu.c.diff;patch=1 \ | ||
71 | file://gtkmenu.h.diff;patch=1 \ | ||
72 | file://gtkmenuitem.c.diff;patch=1 \ | ||
73 | file://gtkmenuitem.h.diff;patch=1 \ | ||
74 | file://gtkmenushell.c.diff;patch=1 \ | ||
75 | file://gtkmenushell.h.diff;patch=1 \ | ||
76 | file://gtknotebook.c.diff;patch=1 \ | ||
77 | file://gtkprogress.c.diff;patch=1 \ | ||
78 | file://gtkprogressbar.c.diff;patch=1 \ | ||
79 | file://gtkradiobutton.c.diff;patch=1 \ | ||
80 | file://gtkrange.c.diff;patch=1 \ | ||
81 | file://gtkrange.h.diff;patch=1 \ | ||
82 | file://gtkrbtree.c.diff;patch=1 \ | ||
83 | file://gtkrc.c.diff;patch=1 \ | ||
84 | file://gtkrc.h.diff;patch=1 \ | ||
85 | file://gtkscrolledwindow.c.diff;patch=1 \ | ||
86 | file://gtkseparator.c.diff;patch=1 \ | ||
87 | file://gtkseparatortoolitem.c.diff;patch=1 \ | ||
88 | file://gtksettings.c.diff;patch=1 \ | ||
89 | file://gtkspinbutton.c.diff;patch=1 \ | ||
90 | file://gtkstyle.c.diff;patch=1 \ | ||
91 | file://gtkstyle.h.diff;patch=1 \ | ||
92 | file://gtktable.c.diff;patch=1 \ | ||
93 | file://gtktextbuffer.c.diff;patch=1 \ | ||
94 | file://gtktextbuffer.h.diff;patch=1 \ | ||
95 | file://gtktextbufferserialize.c.diff;patch=1 \ | ||
96 | file://gtktextbufferserialize.h.diff;patch=1 \ | ||
97 | file://gtktextview.c.diff;patch=1 \ | ||
98 | file://gtktoolbar.c.diff;patch=1 \ | ||
99 | file://gtktoolbutton.c.diff;patch=1 \ | ||
100 | file://gtktoolbutton.h.diff;patch=1 \ | ||
101 | file://gtktreemodelfilter.c.diff;patch=1 \ | ||
102 | file://gtktreemodelsort.c.diff;patch=1 \ | ||
103 | file://gtktreeprivate.h.diff;patch=1 \ | ||
104 | file://gtktreeselection.c.diff;patch=1 \ | ||
105 | file://gtktreeview.c.diff;patch=1 \ | ||
106 | file://gtktreeview.h.diff;patch=1 \ | ||
107 | file://gtktreeviewcolumn.c.diff;patch=1 \ | ||
108 | file://gtktypebuiltins.c.diff;patch=1 \ | ||
109 | file://gtktypebuiltins.h.diff;patch=1 \ | ||
110 | file://gtkvseparator.c.diff;patch=1 \ | ||
111 | file://gtkwidget.c.diff;patch=1 \ | ||
112 | file://gtkwidget.h.diff;patch=1 \ | ||
113 | file://gtkwindow.c.diff;patch=1 \ | ||
114 | file://gtkwindow.h.diff;patch=1 \ | ||
115 | file://io-gif-animation.c.diff;patch=1 \ | ||
116 | file://io-gif.c.diff;patch=1" | ||
117 | |||
118 | inherit autotools pkgconfig | ||
119 | |||
120 | FILES_${PN} = "${bindir}/gdk-pixbuf-query-loaders \ | ||
121 | ${bindir}/gtk-query-immodules-2.0 \ | ||
122 | ${libdir}/lib*.so.* \ | ||
123 | ${datadir}/themes ${sysconfdir} \ | ||
124 | ${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so" | ||
125 | FILES_${PN}-dev += "${datadir}/gtk-2.0/include ${libdir}/gtk-2.0/include ${bindir}/gdk-pixbuf-csource" | ||
126 | |||
127 | RRECOMMENDS_${PN} = "glibc-gconv-iso8859-1" | ||
128 | |||
129 | EXTRA_OECONF = "--without-libtiff --disable-xkb --disable-glibtest --enable-display-migration" | ||
130 | # --disable-cruft | ||
131 | |||
132 | LIBV = "2.4.0" | ||
133 | |||
134 | do_stage () { | ||
135 | oe_libinstall -so -C gtk libgtk-x11-2.0 ${STAGING_LIBDIR} | ||
136 | oe_libinstall -so -C gdk libgdk-x11-2.0 ${STAGING_LIBDIR} | ||
137 | oe_libinstall -so -C contrib/gdk-pixbuf-xlib libgdk_pixbuf_xlib-2.0 ${STAGING_LIBDIR} | ||
138 | oe_libinstall -so -C gdk-pixbuf libgdk_pixbuf-2.0 ${STAGING_LIBDIR} | ||
139 | |||
140 | autotools_stage_includes | ||
141 | |||
142 | mkdir -p ${STAGING_LIBDIR}/gtk-2.0/include | ||
143 | install -m 0644 gdk/gdkconfig.h ${STAGING_LIBDIR}/gtk-2.0/include/gdkconfig.h | ||
144 | |||
145 | install -m 0644 m4macros/gtk-2.0.m4 ${STAGING_DATADIR}/aclocal/ | ||
146 | } | ||
147 | |||
148 | do_install_append () { | ||
149 | install -d ${D}${sysconfdir}/gtk-2.0 | ||
150 | } | ||
151 | |||
152 | PACKAGES_DYNAMIC = "gdk-pixbuf-loader-* gtk-immodule-*" | ||
153 | |||
154 | python populate_packages_prepend () { | ||
155 | import os.path | ||
156 | |||
157 | gtk_libdir = bb.data.expand('${libdir}/gtk-2.0/${LIBV}', d) | ||
158 | loaders_root = os.path.join(gtk_libdir, 'loaders') | ||
159 | immodules_root = os.path.join(gtk_libdir, 'immodules') | ||
160 | |||
161 | do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders') | ||
162 | do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', 'gtk-query-immodules > /etc/gtk-2.0/gtk.immodules') | ||
163 | |||
164 | if (bb.data.getVar('DEBIAN_NAMES', d, 1)): | ||
165 | bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d) | ||
166 | } | ||