Compare commits
266 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02cadc9196 | |||
| e608c86f0e | |||
| bca63a5d33 | |||
| 7207dfbc0b | |||
| de18baa285 | |||
| 431a722cb4 | |||
| f335d53a02 | |||
| d302080656 | |||
| baa523023c | |||
| 0c0fdf8b28 | |||
| 5aeb56f131 | |||
| b8d74ef097 | |||
| f30b10304b | |||
| a37fe60d98 | |||
| b4ad37ae12 | |||
| 4722decd6e | |||
| 6eda5e1af1 | |||
| 902c39b5f0 | |||
| 8e09a1bb42 | |||
| 774619c619 | |||
| 6808084c98 | |||
| 0f99673e3c | |||
| fda53249fb | |||
| 2ee022a9b8 | |||
| 1d12b20ec0 | |||
| 5f53d6068b | |||
| e5f4c9cb68 | |||
| f692b06467 | |||
| b2d939f980 | |||
| 12064bf08a | |||
| b46e6f72c2 | |||
| e2c897c6b2 | |||
| 34e15cf5e4 | |||
| e74d5138da | |||
| f03ee0eae7 | |||
| 21b6ed0024 | |||
| f0470f324f | |||
| a513619a93 | |||
| a7c6f4b12f | |||
| cb6fc02331 | |||
| b12b6a1c0c | |||
| 35f2ae1b04 | |||
| caf17bae51 | |||
| 4e83fe3789 | |||
| e25fac892f | |||
| d3558f7ed0 | |||
| 03928c314d | |||
| 0c1868687b | |||
| dfe3abc6bb | |||
| 592d066f47 | |||
| 96469e5c58 | |||
| a60f34aa64 | |||
| 7c559c84bd | |||
| 6659bc7689 | |||
| 856280b3a2 | |||
| 9ea1a43096 | |||
| 4b2738a1f9 | |||
| 76f0399c32 | |||
| 35da76eb76 | |||
| e2db438a36 | |||
| b3a1c4cdb7 | |||
| fa490ed236 | |||
| 828f8f1790 | |||
| 9e33d2fdb2 | |||
| 9a48d49800 | |||
| ef3d6268cb | |||
| 18c9a83f6a | |||
| 6c34731239 | |||
| a30defcfb7 | |||
| 1cc736c580 | |||
| a7b56ed43a | |||
| 0c5a240d95 | |||
| 7bff1ab7f1 | |||
| 5e70dc2195 | |||
| d4dd35cc91 | |||
| a0dd1f6422 | |||
| d25d08df51 | |||
| 60a234502d | |||
| 4aebc900bf | |||
| a57007f3dc | |||
| 3e2b7e6e73 | |||
| 1e5c150247 | |||
| 29a894798f | |||
| fe44a57d85 | |||
| 8fbbb83346 | |||
| 16ce403888 | |||
| 458838db34 | |||
| d3600de92b | |||
| 4e8c9fd5f8 | |||
| b57b98d90a | |||
| 93e373f0b4 | |||
| 38cdac231c | |||
| 14355e7c80 | |||
| 012d8d6db4 | |||
| 1df7de983e | |||
| 141e5c5822 | |||
| a74a80316c | |||
| 3c1fc24f61 | |||
| 72ccf58edd | |||
| e127a96aec | |||
| ea9d754c98 | |||
| 0e041a4ec8 | |||
| 08575ff7da | |||
| 82e6e840eb | |||
| e71e55d9a4 | |||
| 0f7f6be8e9 | |||
| 0339de7d61 | |||
| 24fec1aa10 | |||
| b4f7784a84 | |||
| ea93a69ab0 | |||
| b9200e9fc5 | |||
| 6562773a5a | |||
| f5562e56e0 | |||
| 5480e6df2f | |||
| e34eab22da | |||
| 1caa77bff2 | |||
| f6acde711b | |||
| ad8b4aa0a3 | |||
| 1cd1200389 | |||
| 52d4111e05 | |||
| 029c0c57fb | |||
| b14bb6fab7 | |||
| 2765a5dc29 | |||
| 69f8c2e191 | |||
| fdf7779855 | |||
| 8336011a85 | |||
| 5c99c4191d | |||
| af408222c8 | |||
| d4cc6b28e3 | |||
| 3b055b39f2 | |||
| 3c7e718b50 | |||
| 61d98323eb | |||
| f681b064bf | |||
| 85b1a31c26 | |||
| 1f8e9d3940 | |||
| 8bca0c3613 | |||
| 38ed5b667b | |||
| cd718e6e36 | |||
| f1585b7a71 | |||
| 49cbd0eed8 | |||
| f6fbddcfe9 | |||
| 2c3c209251 | |||
| 298c435472 | |||
| 730f0f6f3c | |||
| 4fc5f91b8b | |||
| 61a352d098 | |||
| 283bfba565 | |||
| 45029c6757 | |||
| 3dac77f834 | |||
| 4f17bf78b3 | |||
| d11badd3e7 | |||
| 55a7c31665 | |||
| 8d0574f9cf | |||
| 2216c39e7b | |||
| d28b8f4088 | |||
| fd5394784a | |||
| eed718e4e6 | |||
| db1593b8be | |||
| 9f3677418b | |||
| 9c4dd6ae2d | |||
| 46136af6dc | |||
| 96d8e1a1bf | |||
| 68e7f35d09 | |||
| e85e700956 | |||
| 115784bb38 | |||
| d097228c65 | |||
| e5a2f7918b | |||
| 75732772a8 | |||
| baace30f74 | |||
| ab468d6f14 | |||
| 25715c3e29 | |||
| 88de2b3ec7 | |||
| ca488d49a1 | |||
| a7f47a40cf | |||
| e735139d68 | |||
| b3aa6a8cac | |||
| 8fb41e93d3 | |||
| 1b7d3176f5 | |||
| 596dbc3ce8 | |||
| cd90db1183 | |||
| 897cf3b056 | |||
| 099eec9a9f | |||
| 834e201312 | |||
| 3504894d6e | |||
| 0d74b72f3e | |||
| 8ef635d70f | |||
| 1cfa260e5f | |||
| 9fe8aa7720 | |||
| 2a0d8d75d6 | |||
| 77ddd7a36c | |||
| 10e0f1987d | |||
| 8c4c96adc7 | |||
| 61011d78f4 | |||
| 59bfd418f8 | |||
| 76759f3410 | |||
| 74da02e12e | |||
| e4c92bc39d | |||
| bd3c57680e | |||
| e02da6db6e | |||
| 18f28738c3 | |||
| 44a2993b28 | |||
| d479089f90 | |||
| 6648dc472c | |||
| 22ee9e6c58 | |||
| d18a438c0c | |||
| 878c63a65f | |||
| 51c6946dfb | |||
| bd327b904e | |||
| 922f4b758d | |||
| 10b0e1f552 | |||
| 477dc904aa | |||
| afb3753cee | |||
| 2220844829 | |||
| b308f4bb7f | |||
| dd82bb711d | |||
| 8e4ed16d9d | |||
| 7d5a80c6e6 | |||
| 3ddd8080e4 | |||
| 18f9b50665 | |||
| b3549a7813 | |||
| 73060c73fa | |||
| 3500552ac9 | |||
| 4e0391e73f | |||
| e2573ade4f | |||
| 01635ceb4b | |||
| d64ae9b682 | |||
| b45279ee5b | |||
| b199e7e7de | |||
| 38aec4a63e | |||
| 9dfc161c87 | |||
| 1c705dd477 | |||
| c9e6506fa0 | |||
| be1977f4ea | |||
| 7e6a27464a | |||
| fd065333eb | |||
| 3d74f1d64b | |||
| 17267663ad | |||
| 48817f35e3 | |||
| 6823afb03d | |||
| 3d52e58cdd | |||
| f16215fd66 | |||
| 1d1b02b9a4 | |||
| 9d6836145a | |||
| 3ed761f3ba | |||
| 20816d91eb | |||
| 47daaa2e88 | |||
| bd60a8f839 | |||
| 767cd6abd9 | |||
| 045b188be0 | |||
| 84db15f503 | |||
| 2feb926544 | |||
| a915d5b34d | |||
| 017eceaad2 | |||
| 15a7fbbb12 | |||
| b9e87239a8 | |||
| a37a5febe8 | |||
| 50221cc0ea | |||
| c8c087e2fe | |||
| 4586870479 | |||
| 1dd674cfbb | |||
| 86c3f0ed56 | |||
| b33b49d6fb | |||
| 3c0ca31948 | |||
| 70bce53b8e | |||
| ebc47dba8d | |||
| 1cfd18662b |
+1126
File diff suppressed because it is too large
Load Diff
@@ -18,8 +18,8 @@ GTK+ requires the following packages:
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-2.8.2.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.8.2 # change to the toplevel directory
|
||||
% gzip -cd gtk+-2.8.8.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.8.8 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
|
||||
@@ -1,3 +1,154 @@
|
||||
Overview of Changes from GTK+ 2.8.7 to GTK+ 2.8.8
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Make F2 work for renaming bookmarks [Jaap A. Haitsma,
|
||||
Paolo Borelli]
|
||||
* GtkEntry
|
||||
- Turn off input methods in password entries [James Su]
|
||||
* Win32 changes
|
||||
- Various visual improvements to the ms-windows
|
||||
theme [Dom Lachowicz]
|
||||
- Rework window decoration handling [Tor Lillqvist]
|
||||
- Fix localized weekday and month names in GtkCalendar [Tor]
|
||||
- Make urgency hint work on NT4 [Tor]
|
||||
* Other fixes [Arjan van de Ven, Philip Langdale, Jens
|
||||
Granseuer, Bogdan Nicula, Benedikt Meurer, Michael
|
||||
Natterer, Kazuki Iwamoto, Paolo Borelli, Søren Sandmann,
|
||||
Jean-Yves Lefort, Milosz Derezynski, Tze'ela Hebron]
|
||||
* Documentation improvements [Elie De Brauwer]
|
||||
* Updated translations (be,hu,sk,th,wa)
|
||||
|
||||
Overview of Changes from GTK+ 2.8.6 to GTK+ 2.8.7
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Don't special-case the names of Home and Desktop
|
||||
[Federico Mena Quintero]
|
||||
- Avoid loading more than one directory initially.
|
||||
[Federico]
|
||||
- Make the file chooser work better with window
|
||||
groups [Christian Persch]
|
||||
- Improve keynav in the pathbar [Carlos Garnacho,
|
||||
Andrei Yurkevich]
|
||||
- Don't access unmounted volumes [Federico]
|
||||
* GtkTextView
|
||||
- Avoid quadratic blowup when deleting text with
|
||||
lots of tags [Matthias Clasen]
|
||||
- Fix drag-selection corner cases [Arvind S N,
|
||||
Paolo Borelli]
|
||||
* GtkEntry
|
||||
- Add the entry completion popup to the window
|
||||
group [Christian Persch]
|
||||
* GtkTreeView
|
||||
- Fix background drawing in RTL locales [Eric Cazeaux]
|
||||
- Handle Shift-G for going back in typeahead
|
||||
search [Christian Neumair]
|
||||
* GtkComboBox
|
||||
- Leave Ctrl-PageUp/PageDown to applications
|
||||
[Christian Neumair]
|
||||
* Fix compilation problems with gtkcalendar.c
|
||||
[Matthias Hasselmann]
|
||||
* Add labels for GTK_STOCK_CONNECT and
|
||||
GTK_STOCK_DISCONNECT items [Richard Hult]
|
||||
* Resolve symbols in dlopened modules lazily [Laszlo
|
||||
Peter]
|
||||
* GDK
|
||||
- Don't try to set overlarge window icons [Claudio
|
||||
Saavedra]
|
||||
- Improve handling of odd keymaps [Kean Johnston]
|
||||
* Win32 changes
|
||||
- Speed up compositing [John Ehresman]
|
||||
- Improve handling of clipboard [Tor Lillqvist]
|
||||
- Improve visuals of scrollbars, toolbars, handleboxes
|
||||
and menubars in the ms-windows theme [Dom Lachowicz]
|
||||
- Make icon masks work on Win98 [Peter Zelezny]
|
||||
- Hide resize and maximize buttons on non-resizable
|
||||
windows [Tor]
|
||||
- Don't hide dotfiles [Tor]
|
||||
* Bug fixes [Kazuki Iwamoto, Ross Burton, Michael
|
||||
Natterer, Bogdan Nicula, Damien Carbery, Gustavo
|
||||
Carneiro, Tommi Komulainen, Thomas Klausner,
|
||||
Alexander Larsson, Bastien Nocera, Federico
|
||||
Mena Quintero, John Ehresman, Paolo Borelli,
|
||||
Antonio Sacchi, Christian Persch, Carlos
|
||||
Garnacho, Jeremy Cook, Nickolay V. Shmyrev,
|
||||
Richard Hult, Maxim Udushlivy, Peter Zelezny]
|
||||
* Documentation improvements [Paolo Borelli,
|
||||
Christian Neumair, Christian Persch
|
||||
|
||||
Overview of Changes from GTK+ 2.8.5 to GTK+ 2.8.6
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Don't reload the current folder unnecessarily on map [Federico
|
||||
Mena Quintero]
|
||||
* Revert a change from 2.8.5 that could lead to assertion
|
||||
failures when finalizing GtkStyles [Matthias Clasen]
|
||||
* Remove context prefixes from Portugese translations [Duarte
|
||||
Henriques]
|
||||
|
||||
Overview of Changes from GTK+ 2.8.4 to GTK+ 2.8.5
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Don't clear the file name entry too often when
|
||||
in SAVE mode. [Jürg Billeter]
|
||||
- Reduce the startup time in OPEN mode [Federico
|
||||
Mena Quintero]
|
||||
* Stop drag in GtkPaned when grab shadowed [Matthias Clasen]
|
||||
* Correct the calculation for the first weekday
|
||||
in GtkCalendar [Matthias Clasen]
|
||||
* Use a larger buffer when determining the image
|
||||
format in gdk-pixbuf [Sebastian Bacher, Dom Lachowicz]
|
||||
* Win32 bug fixes [Kazuki Iwamoto, Tor Lillqvist]
|
||||
* Other bug fixes [Tor Lillqvist, Gustavo Carneiro,
|
||||
Paolo Borelli, Ray Strode, Søren Sandmann, Tommi Komulainen,
|
||||
Benjamin Berg]
|
||||
|
||||
Overview of Changes from GTK+ 2.8.3 to GTK+ 2.8.4
|
||||
=================================================
|
||||
* GtkFileChooser
|
||||
- Turn off the profiling code [Federico Mena Quintero]
|
||||
* GtkEntryCompletion
|
||||
- Make completion work with multibyte characters
|
||||
[Tommi Komulainen]
|
||||
- Improve positioning of large popups [Tommi Komulainen]
|
||||
* GtkTreeView
|
||||
- Make column reordering by DND work better [Dan
|
||||
Winship]
|
||||
* GtkCalendar
|
||||
- Correctly determine the first weekday from
|
||||
nl_langinfo() [Stanislav Brabec]
|
||||
* GtkFontSel, GtkFontButton
|
||||
- Handle invalid font names better [Michael R. Walton,
|
||||
Ed Catmur]
|
||||
* Deliver destroy events [Chris Lahey]
|
||||
* Fix redrawing of widgets in the the presence
|
||||
of shaped child windows [Dan Winship]
|
||||
* Win32 changes
|
||||
- Prune unnecessary mouse events [Tor Lillqvist]
|
||||
- Fix memory corruption when using display
|
||||
names [Tor Lillqvist]
|
||||
* Other bug fixes [Alexander Larsson, John Cupitt,
|
||||
John Finlay, Kjartan Maraas, Thomas Leonard,
|
||||
Guillaume Cottenceau, Alexander Nedotsukov, Tim Janik,
|
||||
Tor Lillqvist, Tommi Komulainen
|
||||
* Documentation improvements [Guillaume Cottenceau,
|
||||
Torsten Schoenfeld, Damon Chaplin, Vincent Untz,
|
||||
Tommi Komulainen, Federico Mena Quintero
|
||||
* New and updated translations (bg,bn,et,eu,fr,gl,hi,it,
|
||||
ku,ru,sr,sv,tr,vi)
|
||||
|
||||
Overview of Changes from GTK+ 2.8.2 to GTK+ 2.8.3
|
||||
=================================================
|
||||
* Fix problems with the handling of initial settings
|
||||
for font options and cursor themes [Frederic Crozat,
|
||||
Joe Markus Clarke, Owen Taylor, Kjartan Maraas]
|
||||
* Add a --ignore-theme-index option to
|
||||
gtk-update-icon-cache [JP Rosevaar]
|
||||
* Other bug fixes [Christian Persch, Owen Taylor,
|
||||
Ed Catmur, Thomas Fitzsimmons, JP Rosevaar, Tor
|
||||
Lillqvist, Colin Walters, Yong Wang, Matthias,
|
||||
Kjartan Maraas, Christian Persch, Mark McLoughlin]
|
||||
* Updated translations (ca,es,fr,pt_BR)
|
||||
|
||||
Overview of Changes from GTK+ 2.8.1 to GTK+ 2.8.2
|
||||
=================================================
|
||||
* Fix a crash with custom icon themes, which affected
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 2.8.2. GTK+ is a multi-platform toolkit for
|
||||
This is GTK+ version 2.8.8. GTK+ is a multi-platform toolkit for
|
||||
creating graphical user interfaces. Offering a complete set of widgets,
|
||||
GTK+ is suitable for projects ranging from small one-off projects to
|
||||
complete application suites.
|
||||
|
||||
+8
-5
@@ -12,10 +12,10 @@ AC_PREREQ(2.54)
|
||||
|
||||
m4_define([gtk_major_version], [2])
|
||||
m4_define([gtk_minor_version], [8])
|
||||
m4_define([gtk_micro_version], [2])
|
||||
m4_define([gtk_micro_version], [8])
|
||||
m4_define([gtk_version],
|
||||
[gtk_major_version.gtk_minor_version.gtk_micro_version])
|
||||
m4_define([gtk_interface_age], [2])
|
||||
m4_define([gtk_interface_age], [8])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
# This is the X.Y used in -lgtk-FOO-X.Y
|
||||
@@ -433,7 +433,7 @@ fi
|
||||
# sure that both po/ and po-properties/ have .po files that correspond
|
||||
# to your language. If you only add one to po/, the build will break
|
||||
# in po-properties/.
|
||||
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 hy 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 te th tk tr uk uz uz@Latn vi wa xh yi zh_CN zh_TW"
|
||||
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 hy ia id is it ja ko ku 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 te th tk tr uk uz uz@Latn vi wa xh yi zh_CN zh_TW"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
@@ -1388,9 +1388,12 @@ fi
|
||||
CFLAGS="$saved_cflags"
|
||||
LDFLAGS="$saved_ldflags"
|
||||
|
||||
GDK_PACKAGES="$PANGO_PACKAGES $X_PACKAGES"
|
||||
GDK_PACKAGES="$PANGO_PACKAGES"
|
||||
if test "x$gdktarget" = "xx11"; then
|
||||
GDK_PACKAGES="$GDK_PACKAGES $X_PACKAGES"
|
||||
fi
|
||||
GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
|
||||
GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $X_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
|
||||
GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
|
||||
|
||||
#
|
||||
# If we aren't writing explicit dependencies, then don't put the extra libraries we need
|
||||
|
||||
@@ -1,3 +1,38 @@
|
||||
2005-11-28 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.8 ===
|
||||
|
||||
2005-11-17 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-xlib-drawable.c:
|
||||
* gdk-pixbuf-xlibrgb.c: const correctness fixes
|
||||
found by Arjan van de Ven and gcc.
|
||||
|
||||
2005-11-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.7 ===
|
||||
|
||||
2005-10-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-xlib-2.0.pc.in (Requires): Require
|
||||
gmodule-no-export-2.0 instead of gmodule-2.0
|
||||
|
||||
2005-10-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.6 ===
|
||||
|
||||
2005-10-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.5 ===
|
||||
|
||||
2005-09-27 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.4 ===
|
||||
|
||||
2005-08-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.3 ===
|
||||
|
||||
2005-08-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.2 ===
|
||||
|
||||
@@ -6,6 +6,6 @@ includedir=@includedir@
|
||||
Name: GdkPixbuf Xlib
|
||||
Description: GdkPixbuf rendering for Xlib
|
||||
Version: @VERSION@
|
||||
Requires: gobject-2.0,gmodule-2.0,gdk-pixbuf-2.0
|
||||
Requires: gobject-2.0,gmodule-no-export-2.0,gdk-pixbuf-2.0
|
||||
Libs: -L${libdir} -lgdk_pixbuf_xlib-@GTK_API_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
|
||||
|
||||
static guint32 mask_table[] = {
|
||||
static const guint32 mask_table[] = {
|
||||
0x00000000, 0x00000001, 0x00000003, 0x00000007,
|
||||
0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f,
|
||||
0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff,
|
||||
@@ -1058,7 +1058,7 @@ convert_real_slow (XImage *image, guchar *pixels, int rowstride, xlib_colormap *
|
||||
|
||||
typedef void (* cfunc) (XImage *image, guchar *pixels, int rowstride, xlib_colormap *cmap);
|
||||
|
||||
static cfunc convert_map[] = {
|
||||
static const cfunc convert_map[] = {
|
||||
rgb1,rgb1,rgb1a,rgb1a,
|
||||
rgb8,rgb8,rgb8a,rgb8a,
|
||||
rgb555lsb,rgb555msb,rgb555alsb,rgb555amsb,
|
||||
|
||||
@@ -516,7 +516,7 @@ static guint32
|
||||
xlib_rgb_score_visual (XVisualInfo *visual)
|
||||
{
|
||||
guint32 quality, speed, pseudo, sys;
|
||||
static const char* visual_names[] =
|
||||
static const char * const visual_names[] =
|
||||
{
|
||||
"static gray",
|
||||
"grayscale",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
#include "demo-common.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
@@ -132,8 +133,8 @@ about_cb (GtkAction *action,
|
||||
gtk_about_dialog_set_url_hook (activate_url, NULL, NULL);
|
||||
gtk_show_about_dialog (GTK_WINDOW (window),
|
||||
"name", "GTK+ Code Demos",
|
||||
"version", "2.4.3",
|
||||
"copyright", "(C) 1997-2004 The GTK+ Team",
|
||||
"version", PACKAGE_VERSION,
|
||||
"copyright", "(C) 1997-2005 The GTK+ Team",
|
||||
"license", license,
|
||||
"website", "http://www.gtk.org",
|
||||
"comments", "Program to demonstrate GTK+ functions.",
|
||||
|
||||
@@ -41,7 +41,8 @@ paste_received (GtkClipboard *clipboard,
|
||||
entry = GTK_WIDGET (user_data);
|
||||
|
||||
/* Set the entry text */
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), text);
|
||||
if(text)
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), text);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <demos.h>
|
||||
|
||||
static GtkTextBuffer *info_buffer;
|
||||
static GtkTextBuffer *source_buffer;
|
||||
|
||||
static gchar *current_file = NULL;
|
||||
|
||||
enum {
|
||||
TITLE_COLUMN,
|
||||
FILENAME_COLUMN,
|
||||
FUNC_COLUMN,
|
||||
ITALIC_COLUMN,
|
||||
NUM_COLUMNS
|
||||
};
|
||||
|
||||
gboolean
|
||||
read_line (FILE *stream, GString *str)
|
||||
{
|
||||
int n_read = 0;
|
||||
|
||||
flockfile (stream);
|
||||
|
||||
g_string_truncate (str, 0);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int c;
|
||||
|
||||
c = getc_unlocked (stream);
|
||||
|
||||
if (c == EOF)
|
||||
goto done;
|
||||
else
|
||||
n_read++;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\r':
|
||||
case '\n':
|
||||
{
|
||||
int next_c = getc_unlocked (stream);
|
||||
|
||||
if (!(next_c == EOF ||
|
||||
(c == '\r' && next_c == '\n') ||
|
||||
(c == '\n' && next_c == '\r')))
|
||||
ungetc (next_c, stream);
|
||||
|
||||
goto done;
|
||||
}
|
||||
default:
|
||||
g_string_append_c (str, c);
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
funlockfile (stream);
|
||||
|
||||
return n_read > 0;
|
||||
}
|
||||
|
||||
void
|
||||
load_file (const gchar *filename)
|
||||
{
|
||||
FILE *file;
|
||||
GtkTextIter start, end;
|
||||
GString *buffer = g_string_new (NULL);
|
||||
int state = 0;
|
||||
gboolean in_para = 0;
|
||||
|
||||
if (current_file && !strcmp (current_file, filename))
|
||||
return;
|
||||
|
||||
g_free (current_file);
|
||||
current_file = g_strdup (filename);
|
||||
|
||||
gtk_text_buffer_get_bounds (info_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (info_buffer, &start, &end);
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (source_buffer, &start, &end);
|
||||
|
||||
file = fopen (filename, "r");
|
||||
if (!file)
|
||||
{
|
||||
g_warning ("Cannot open %s: %s\n", filename, g_strerror (errno));
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
|
||||
while (read_line (file, buffer))
|
||||
{
|
||||
gchar *p = buffer->str;
|
||||
gchar *q;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
/* Reading title */
|
||||
while (*p == '/' || *p == '*' || isspace (*p))
|
||||
p++;
|
||||
q = p + strlen (p);
|
||||
while (q > p && isspace (*(q - 1)))
|
||||
q--;
|
||||
|
||||
if (q > p)
|
||||
{
|
||||
int len_chars = g_utf8_pointer_to_offset (p, q);
|
||||
|
||||
end = start;
|
||||
|
||||
g_assert (strlen (p) >= q - p);
|
||||
gtk_text_buffer_insert (info_buffer, &end, p, q - p);
|
||||
start = end;
|
||||
|
||||
gtk_text_iter_backward_chars (&start, len_chars);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "title", &start, &end);
|
||||
|
||||
start = end;
|
||||
|
||||
state++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
/* Reading body of info section */
|
||||
while (isspace (*p))
|
||||
p++;
|
||||
if (*p == '*' && *(p + 1) == '/')
|
||||
{
|
||||
gtk_text_buffer_get_iter_at_offset (source_buffer, &start, 0);
|
||||
state++;
|
||||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
|
||||
while (*p == '*' || isspace (*p))
|
||||
p++;
|
||||
|
||||
len = strlen (p);
|
||||
while (isspace (*(p + len - 1)))
|
||||
len--;
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
if (in_para)
|
||||
gtk_text_buffer_insert (info_buffer, &start, " ", 1);
|
||||
|
||||
g_assert (strlen (p) >= len);
|
||||
gtk_text_buffer_insert (info_buffer, &start, p, len);
|
||||
in_para = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_text_buffer_insert (info_buffer, &start, "\n", 1);
|
||||
in_para = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
/* Skipping blank lines */
|
||||
while (isspace (*p))
|
||||
p++;
|
||||
if (*p)
|
||||
{
|
||||
p = buffer->str;
|
||||
state++;
|
||||
/* Fall through */
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* Reading program body */
|
||||
gtk_text_buffer_insert (source_buffer, &start, p, -1);
|
||||
gtk_text_buffer_insert (info_buffer, &start, "\n", 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
gtk_text_buffer_apply_tag_by_name (info_buffer, "source", &start, &end);
|
||||
}
|
||||
|
||||
gboolean
|
||||
button_press_event_cb (GtkTreeView *tree_view,
|
||||
GdkEventButton *event,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
if (event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
GtkTreePath *path = NULL;
|
||||
|
||||
gtk_tree_view_get_path_at_pos (tree_view,
|
||||
event->window,
|
||||
event->x,
|
||||
event->y,
|
||||
&path,
|
||||
NULL);
|
||||
|
||||
if (path)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean italic;
|
||||
GVoidFunc func;
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_tree_store_get (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
FUNC_COLUMN, &func,
|
||||
ITALIC_COLUMN, &italic,
|
||||
-1);
|
||||
(func) ();
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
ITALIC_COLUMN, !italic,
|
||||
-1);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
gtk_signal_emit_stop_by_name (GTK_OBJECT (tree_view),
|
||||
"button_press_event");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
selection_cb (GtkTreeSelection *selection,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GValue value = {0, };
|
||||
|
||||
if (! gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
return;
|
||||
|
||||
gtk_tree_model_get_value (model, &iter,
|
||||
FILENAME_COLUMN,
|
||||
&value);
|
||||
load_file (g_value_get_string (&value));
|
||||
g_value_unset (&value);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
create_text (GtkTextBuffer **buffer,
|
||||
gboolean is_source)
|
||||
{
|
||||
GtkWidget *scrolled_window;
|
||||
GtkWidget *text_view;
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_SHADOW_IN);
|
||||
|
||||
text_view = gtk_text_view_new ();
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
||||
|
||||
*buffer = gtk_text_buffer_new (NULL);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text_view), *buffer);
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
|
||||
|
||||
if (is_source)
|
||||
{
|
||||
font_desc = pango_font_description_from_string ("Courier 10");
|
||||
gtk_widget_modify_font (text_view, font_desc);
|
||||
pango_font_description_free (font_desc);
|
||||
}
|
||||
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), !is_source);
|
||||
|
||||
return scrolled_window;
|
||||
}
|
||||
|
||||
/* Technically a list, but if we do go to 80 demos, we may want to move to a tree */
|
||||
static GtkWidget *
|
||||
create_tree (void)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
GtkCellRenderer *cell;
|
||||
GtkWidget *tree_view;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeStore *model;
|
||||
GtkTreeIter iter;
|
||||
gint i;
|
||||
|
||||
model = gtk_tree_store_new_with_types (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
|
||||
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
|
||||
|
||||
gtk_tree_selection_set_type (GTK_TREE_SELECTION (selection),
|
||||
GTK_TREE_SELECTION_SINGLE);
|
||||
gtk_widget_set_usize (tree_view, 200, -1);
|
||||
|
||||
for (i=0; i < G_N_ELEMENTS (testgtk_demos); i++)
|
||||
{
|
||||
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL);
|
||||
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
TITLE_COLUMN, testgtk_demos[i].title,
|
||||
FILENAME_COLUMN, testgtk_demos[i].filename,
|
||||
FUNC_COLUMN, testgtk_demos[i].func,
|
||||
ITALIC_COLUMN, FALSE,
|
||||
-1);
|
||||
}
|
||||
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes ("Widget",
|
||||
cell,
|
||||
"text", TITLE_COLUMN,
|
||||
"italic", ITALIC_COLUMN,
|
||||
NULL);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
|
||||
GTK_TREE_VIEW_COLUMN (column));
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (selection), "selection_changed", selection_cb, model);
|
||||
gtk_signal_connect (GTK_OBJECT (tree_view), "button_press_event", GTK_SIGNAL_FUNC (button_press_event_cb), model);
|
||||
|
||||
return tree_view;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *notebook;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *tree;
|
||||
GtkTextTag *tag;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), hbox);
|
||||
|
||||
tree = create_tree ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), tree, FALSE, FALSE, 0);
|
||||
|
||||
notebook = gtk_notebook_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), notebook, TRUE, TRUE, 0);
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&info_buffer, FALSE),
|
||||
gtk_label_new ("Info"));
|
||||
|
||||
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
create_text (&source_buffer, TRUE),
|
||||
gtk_label_new ("Source"));
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "title");
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Sans 18",
|
||||
NULL);
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "source");
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Courier 10",
|
||||
"pixels_above_lines", 0,
|
||||
"pixels_below_lines", 0,
|
||||
NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
|
||||
load_file (testgtk_demos[0].filename);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,3 +1,50 @@
|
||||
2005-11-28 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.8 ===
|
||||
|
||||
2005-11-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.7 ===
|
||||
|
||||
2005-10-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.6 ===
|
||||
|
||||
2005-10-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.5 ===
|
||||
|
||||
2005-09-27 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.4 ===
|
||||
|
||||
2005-09-15 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
* gtk/tmpl/gtkfilechooser.sgml: List all the default key bindings.
|
||||
Fix the documentation for the "location-popup" binding signal; its
|
||||
"path" argument was not listed. Mention a tip to have a crude
|
||||
form of bookmarks accessible through key bindings.
|
||||
|
||||
2005-09-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkeditable.sgml: Clarify docs
|
||||
for ::insert-text signal. (#316094, Tommi
|
||||
Komulainen)
|
||||
|
||||
2005-09-05 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkpaned.sgml: Fix some typos.
|
||||
(#315208, Vincent Untz)
|
||||
|
||||
2005-08-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.3 ===
|
||||
|
||||
2005-08-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtk-update-icon-cache.xml:
|
||||
* gtk/gtk-update-icon-cache.1: Updates.
|
||||
|
||||
2005-08-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.2 ===
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
|
||||
.\" Instead of manually editing it, you probably should edit the DocBook XML
|
||||
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
|
||||
.TH "GTK\-UPDATE\-ICON\-CACH" "1" "08/23/2005" "" ""
|
||||
.TH "GTK\-UPDATE\-ICON\-CACH" "1" "08/26/2005" "" ""
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
@@ -11,7 +11,7 @@
|
||||
gtk\-update\-icon\-cache \- Icon theme caching utility
|
||||
.SH "SYNOPSIS"
|
||||
.HP 22
|
||||
\fBgtk\-update\-icon\-cache\fR [\-\-force] [\-\-index\-only] [\-\-quiet] {iconpath}
|
||||
\fBgtk\-update\-icon\-cache\fR [\-\-force] [\-\-index\-only] [\-\-ignore\-theme\-index] [\-\-quiet] {iconpath}
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBgtk\-update\-icon\-cache\fR
|
||||
@@ -31,6 +31,11 @@ to avoid a lot of system call and disk seek overhead when the application starts
|
||||
\-\-force, \-f
|
||||
Overwrite an existing cache file even if it appears to be uptodate.
|
||||
.TP
|
||||
\-\-ignore\-theme\-index, \-t
|
||||
Don't check for the existence of 'index.theme' in the icon theme directory. Without this option,
|
||||
\fBgtk\-update\-icon\-cache\fR
|
||||
refuses to create an icon cache in a directory which does not appear to be the toplevel directory of an icon theme.
|
||||
.TP
|
||||
\-\-index\-only, \-i
|
||||
Don't include image data in the cache.
|
||||
.TP
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<command>gtk-update-icon-cache</command>
|
||||
<arg choice="opt">--force</arg>
|
||||
<arg choice="opt">--index-only</arg>
|
||||
<arg choice="opt">--ignore-theme-index</arg>
|
||||
<arg choice="opt">--quiet</arg>
|
||||
<arg choice="req">iconpath</arg>
|
||||
</cmdsynopsis>
|
||||
@@ -47,6 +48,16 @@ multiple applications, the overall memory consumption is reduced as well.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>--ignore-theme-index</term>
|
||||
<term>-t</term>
|
||||
<listitem><para>Don't check for the existence of 'index.theme' in the icon theme
|
||||
directory. Without this option, <command>gtk-update-icon-cache</command> refuses
|
||||
to create an icon cache in a directory which does not appear to be the toplevel
|
||||
directory of an icon theme.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>--index-only</term>
|
||||
<term>-i</term>
|
||||
|
||||
@@ -125,11 +125,12 @@ it from being inserted entirely.
|
||||
|
||||
@editable: the object which received the signal.
|
||||
@new_text: the new text to insert.
|
||||
@new_text_length: the length of the new text.
|
||||
@position: the position at which to insert the new text.
|
||||
this is an in-out paramter. After the signal
|
||||
emission is finished, it should point after
|
||||
the newly inserted text.
|
||||
@new_text_length: the length of the new text, in bytes,
|
||||
or -1 if new_text is nul-terminated
|
||||
@position: the position, in characters, at which to insert
|
||||
the new text. this is an in-out parameter.
|
||||
After the signal emission is finished, it should
|
||||
point after the newly inserted text.
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_select_region ##### -->
|
||||
<para>
|
||||
|
||||
@@ -204,15 +204,27 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>Signal name</entry>
|
||||
<entry>Key</entry>
|
||||
<entry>Default key combinations</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>location-popup</entry>
|
||||
<entry><keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo></entry>
|
||||
<entry>
|
||||
<keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>;
|
||||
<keycap>/</keycap>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>up-folder</entry>
|
||||
<entry><keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo></entry>
|
||||
<entry>
|
||||
<keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo><footnote>
|
||||
<para>
|
||||
Both the individual Up key and the numeric
|
||||
keypad's Up key are supported.
|
||||
</para>
|
||||
</footnote>
|
||||
;
|
||||
<keycap>Backspace</keycap>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>down-folder</entry>
|
||||
@@ -227,16 +239,14 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
|
||||
</informaltable>
|
||||
|
||||
<para>
|
||||
To change these defaults to something else, you could
|
||||
include the following fragment in your
|
||||
<filename>.gtkrc-2.0</filename> file:
|
||||
You can change these defaults to something else. For
|
||||
example, to add a <keycap>Shift</keycap> modifier to a few
|
||||
of the default bindings, you can include the following
|
||||
fragment in your <filename>.gtkrc-2.0</filename> file:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
binding "my-own-gtkfilechooser-bindings" {
|
||||
bind "<Alt><Shift>l" {
|
||||
"location-popup" ()
|
||||
}
|
||||
bind "<Alt><Shift>Up" {
|
||||
"up-folder" ()
|
||||
}
|
||||
@@ -244,7 +254,7 @@ binding "my-own-gtkfilechooser-bindings" {
|
||||
"down-folder" ()
|
||||
}
|
||||
bind "<Alt><Shift>Home" {
|
||||
"home-folder-folder" ()
|
||||
"home-folder" ()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,14 +267,22 @@ class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
|
||||
|
||||
<programlisting>
|
||||
void user_function (GtkFileChooserDefault *chooser,
|
||||
const char *path,
|
||||
<link linkend="gpointer">gpointer</link> user_data);
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
This is used to make the file chooser show a "Location"
|
||||
dialog which the user can use to manually type the name of
|
||||
the file he wishes to select. By default this is bound to
|
||||
<keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>.
|
||||
the file he wishes to select. The
|
||||
<parameter>path</parameter> argument is a string that gets
|
||||
put in the text entry for the file name. By default this is bound to
|
||||
<keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>
|
||||
with a <parameter>path</parameter> string of "" (the empty
|
||||
string); it is also bound to <keycap>/</keycap> with a
|
||||
<parameter>path</parameter> string of "<literal>/</literal>"
|
||||
(a slash): this lets you type <keycap>/</keycap> and
|
||||
immediately type a path name.
|
||||
</para>
|
||||
|
||||
<variablelist role="params">
|
||||
@@ -276,6 +294,14 @@ class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>path</parameter> :</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
default contents for the text entry for the file name
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>user_data</parameter> :</term>
|
||||
<listitem>
|
||||
@@ -285,6 +311,30 @@ class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<tip>
|
||||
<para>
|
||||
You can create your own bindings for the
|
||||
<symbol>location-popup</symbol> signal with custom
|
||||
<parameter>path</parameter> strings, and have a crude form
|
||||
of easily-to-type bookmarks. For example, say you access
|
||||
the path <filename>/home/username/misc</filename> very
|
||||
frequently. You could then create an <keycombo>
|
||||
<keycap>Alt</keycap> <keycap>M</keycap> </keycombo>
|
||||
shortcut by including the following in your
|
||||
<filename>.gtkrc-2.0</filename>:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
binding "misc-shortcut" {
|
||||
bind "<Alt>M" {
|
||||
"location-popup" ("/home/username/misc")
|
||||
}
|
||||
}
|
||||
|
||||
class "GtkFileChooserDefault" binding "misc-shortcut"
|
||||
</programlisting>
|
||||
</tip>
|
||||
</refsect3>
|
||||
|
||||
<refsect3 id="GtkFileChooserDefault-up-folder">
|
||||
@@ -298,8 +348,9 @@ class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
|
||||
<para>
|
||||
This is used to make the file chooser go to the parent of
|
||||
the current folder in the file hierarchy. By default this
|
||||
is bound to
|
||||
<keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo>.
|
||||
is bound to <keycap>Backspace</keycap> and
|
||||
<keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo>
|
||||
(the Up key in the numeric keypad also works).
|
||||
</para>
|
||||
|
||||
<variablelist role="params">
|
||||
@@ -338,7 +389,8 @@ class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
|
||||
"/foo/<emphasis>bar/</emphasis>baz", then this will cause
|
||||
the file chooser to switch to the "baz" subfolder. By
|
||||
default this is bound to
|
||||
<keycombo><keycap>Alt</keycap><keycap>Down</keycap></keycombo>.
|
||||
<keycombo><keycap>Alt</keycap><keycap>Down</keycap></keycombo>
|
||||
(the Down key in the numeric keypad also works).
|
||||
</para>
|
||||
|
||||
<variablelist role="params">
|
||||
@@ -372,7 +424,8 @@ class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
|
||||
<para>
|
||||
This is used to make the file chooser show the user's home
|
||||
folder in the file list. By default this is bound to
|
||||
<keycombo><keycap>Alt</keycap><keycap>Home</keycap></keycombo>.
|
||||
<keycombo><keycap>Alt</keycap><keycap>Home</keycap></keycombo>
|
||||
(the Home key in the numeric keypad also works).
|
||||
</para>
|
||||
|
||||
<variablelist role="params">
|
||||
|
||||
@@ -201,7 +201,7 @@ Adds a child to the top or left pane.
|
||||
@paned: a paned widget
|
||||
@child: the child to add
|
||||
@resize: should this child expand when the paned widget is resized.
|
||||
@shrink: can this child be made smaller than its requsition.
|
||||
@shrink: can this child be made smaller than its requisition.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paned_pack2 ##### -->
|
||||
@@ -212,7 +212,7 @@ Adds a child to the bottom or right pane.
|
||||
@paned: a paned widget
|
||||
@child: the child to add
|
||||
@resize: should this child expand when the paned widget is resized.
|
||||
@shrink: can this child be made smaller than its requsition.
|
||||
@shrink: can this child be made smaller than its requisition.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paned_get_child1 ##### -->
|
||||
|
||||
@@ -510,5 +510,6 @@ modified directly.
|
||||
</para>
|
||||
|
||||
@values:
|
||||
@Returns:
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,46 @@
|
||||
2005-11-28 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.8 ===
|
||||
|
||||
2005-11-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.7 ===
|
||||
|
||||
2005-11-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-xpm.c: Fix several integer overflows which have been
|
||||
reported as CVE-2005-3186 and CVE-2005-2975.
|
||||
|
||||
2005-10-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_write): Only call
|
||||
gdk_pixbuf_loader_eat_header_write() when count > 0. (#318589,
|
||||
Bogdan Nicula)
|
||||
|
||||
2005-10-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.6 ===
|
||||
|
||||
2005-10-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.5 ===
|
||||
|
||||
2005-10-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file):
|
||||
* gdk-pixbuf-io.c (gdk_pixbuf_new_from_file):
|
||||
* gdk-pixbuf-loader.c: Use a 1k buffer for sniffing image formats,
|
||||
instead of 128 or 256 bytes. (#317225, Sebastien Bacher,
|
||||
Dom Lachowicz)
|
||||
|
||||
2005-09-27 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.4 ===
|
||||
|
||||
2005-08-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.3 ===
|
||||
|
||||
2005-08-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.2 ===
|
||||
|
||||
@@ -370,7 +370,7 @@ gdk-pixbuf-enum-types.h: s-enum-types-h
|
||||
@true
|
||||
|
||||
s-enum-types-h: @REBUILD@ $(gdk_pixbuf_headers) Makefile
|
||||
( cd $(srcdir) && glib-mkenums \
|
||||
( cd $(srcdir) && $(GLIB_MKENUMS) \
|
||||
--fhead "#ifndef __GDK_PIXBUF_ENUM_TYPES_H__\n#define __GDK_PIXBUF_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
|
||||
--fprod "/* enumerations from \"@filename@\" */\n" \
|
||||
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
|
||||
@@ -387,7 +387,7 @@ MAINTAINERCLEANFILES += s-enum-types-h
|
||||
# gdk-pixbuf-enum-types.c
|
||||
#
|
||||
gdk-pixbuf-enum-types.c: @REBUILD@ $(gdk_pixbuf_headers) Makefile
|
||||
(cd $(srcdir) && glib-mkenums \
|
||||
(cd $(srcdir) && $(GLIB_MKENUMS) \
|
||||
--fhead "#include <gdk-pixbuf/gdk-pixbuf.h>\n#include \"gdk-pixbuf-alias.h\"\n" \
|
||||
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||
--ftail "\n#define __GDK_PIXBUF_ENUM_TYPES_C__\n#include \"gdk-pixbuf-aliasdef.c\"" \
|
||||
|
||||
@@ -136,7 +136,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
|
||||
GdkPixbufAnimation *animation;
|
||||
int size;
|
||||
FILE *f;
|
||||
guchar buffer [128];
|
||||
guchar buffer [1024];
|
||||
GdkPixbufModule *image_module;
|
||||
gchar *display_name;
|
||||
gboolean locked = FALSE;
|
||||
|
||||
@@ -839,7 +839,7 @@ gdk_pixbuf_new_from_file (const char *filename,
|
||||
GdkPixbuf *pixbuf;
|
||||
int size;
|
||||
FILE *f;
|
||||
guchar buffer[256];
|
||||
guchar buffer[1024];
|
||||
GdkPixbufModule *image_module;
|
||||
gchar *display_name;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ static guint pixbuf_loader_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
/* Internal data */
|
||||
|
||||
#define LOADER_HEADER_SIZE 128
|
||||
#define LOADER_HEADER_SIZE 1024
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -485,7 +485,7 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
|
||||
/* we expect it's not to be closed */
|
||||
g_return_val_if_fail (priv->closed == FALSE, FALSE);
|
||||
|
||||
if (priv->image_module == NULL)
|
||||
if (count > 0 && priv->image_module == NULL)
|
||||
{
|
||||
gint eaten;
|
||||
|
||||
@@ -727,7 +727,9 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
|
||||
/* we expect it's not closed */
|
||||
g_return_val_if_fail (priv->closed == FALSE, TRUE);
|
||||
|
||||
/* We have less the 128 bytes in the image. Flush it, and keep going. */
|
||||
/* We have less the LOADER_HEADER_SIZE bytes in the image.
|
||||
* Flush it, and keep going.
|
||||
*/
|
||||
if (priv->image_module == NULL)
|
||||
{
|
||||
GError *tmp = NULL;
|
||||
|
||||
+5
-2
@@ -405,7 +405,8 @@ file_buffer (enum buf_op op, gpointer handle)
|
||||
/* Fall through to the xpm_read_string. */
|
||||
|
||||
case op_body:
|
||||
xpm_read_string (h->infile, &h->buffer, &h->buffer_size);
|
||||
if(!xpm_read_string (h->infile, &h->buffer, &h->buffer_size))
|
||||
return NULL;
|
||||
return h->buffer;
|
||||
|
||||
default:
|
||||
@@ -500,7 +501,9 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
|
||||
_("XPM has invalid number of chars per pixel"));
|
||||
return NULL;
|
||||
}
|
||||
if (n_col <= 0 || n_col >= G_MAXINT / (cpp + 1)) {
|
||||
if (n_col <= 0 ||
|
||||
n_col >= G_MAXINT / (cpp + 1) ||
|
||||
n_col >= G_MAXINT / sizeof (XPMColor)) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
|
||||
+2
-2
@@ -234,7 +234,7 @@ BUILT_SOURCES = \
|
||||
gdkenumtypes.h: stamp-gdkenumtypes.h
|
||||
@true
|
||||
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) Makefile
|
||||
( cd $(srcdir) && glib-mkenums \
|
||||
( cd $(srcdir) && $(GLIB_MKENUMS) \
|
||||
--fhead "#ifndef __GDK_ENUM_TYPES_H__\n#define __GDK_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
|
||||
--fprod "/* enumerations from \"@filename@\" */\n" \
|
||||
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
|
||||
@@ -244,7 +244,7 @@ stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) Makefile
|
||||
&& rm -f xgen-geth \
|
||||
&& echo timestamp > $(@F)
|
||||
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) Makefile
|
||||
( cd $(srcdir) && glib-mkenums \
|
||||
( cd $(srcdir) && $(GLIB_MKENUMS) \
|
||||
--fhead "#define GDK_ENABLE_BROKEN\n#include \"gdk.h\"\n#include \"gdkalias.h\"\n" \
|
||||
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||
--ftail "\n#define __GDK_ENUM_TYPES_C__\n#include \"gdkaliasdef.c\"\n" \
|
||||
|
||||
+1
-1
@@ -335,7 +335,7 @@ gdk_color_get_type (void)
|
||||
* by <function>XParseColor</function>; these include
|
||||
* name for a color from <filename>rgb.txt</filename>, such as
|
||||
* <literal>DarkSlateGray</literal>, or a hex specification
|
||||
* such as <literal>305050</literal>.
|
||||
* such as <literal>#3050b2</literal> or <literal>#35b</literal>.
|
||||
*
|
||||
* Return value: %TRUE if the parsing succeeded.
|
||||
**/
|
||||
|
||||
@@ -188,6 +188,10 @@ gdk_gc_finalize (GObject *object)
|
||||
gdk_region_destroy (priv->clip_region);
|
||||
if (gc->colormap)
|
||||
g_object_unref (gc->colormap);
|
||||
if (priv->tile)
|
||||
g_object_unref (priv->tile);
|
||||
if (priv->stipple)
|
||||
g_object_unref (priv->stipple);
|
||||
|
||||
G_OBJECT_CLASS (gdk_gc_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
+5
-5
@@ -53,14 +53,14 @@ gdk_screen_get_type (void)
|
||||
static const GTypeInfo object_info =
|
||||
{
|
||||
sizeof (GdkScreenClass),
|
||||
(GBaseInitFunc) gdk_screen_init,
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gdk_screen_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GdkScreen),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) NULL,
|
||||
(GInstanceInitFunc) gdk_screen_init,
|
||||
};
|
||||
|
||||
object_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
@@ -103,7 +103,7 @@ gdk_screen_class_init (GdkScreenClass *klass)
|
||||
static void
|
||||
gdk_screen_init (GdkScreen *screen)
|
||||
{
|
||||
screen->resolution = -1;
|
||||
screen->resolution = -1.;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -407,7 +407,7 @@ gdk_screen_set_resolution_libgtk_only (GdkScreen *screen,
|
||||
if (dpi >= 0)
|
||||
screen->resolution = dpi;
|
||||
else
|
||||
screen->resolution = -1;
|
||||
screen->resolution = -1.;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -423,7 +423,7 @@ gdk_screen_set_resolution_libgtk_only (GdkScreen *screen,
|
||||
gdouble
|
||||
gdk_screen_get_resolution_libgtk_only (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), -1.);
|
||||
|
||||
return screen->resolution;
|
||||
}
|
||||
|
||||
+1
-1
@@ -2450,7 +2450,7 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window,
|
||||
child_region = gdk_region_rectangle (&child_rect);
|
||||
|
||||
/* remove child area from the invalid area of the parent */
|
||||
if (GDK_WINDOW_IS_MAPPED (child))
|
||||
if (GDK_WINDOW_IS_MAPPED (child) && !child->shaped)
|
||||
gdk_region_subtract (visible_region, child_region);
|
||||
|
||||
if (child_func && (*child_func) ((GdkWindow *)child, user_data))
|
||||
|
||||
@@ -287,6 +287,7 @@ struct _GdkWindowObject
|
||||
|
||||
guint accept_focus : 1;
|
||||
guint focus_on_map : 1;
|
||||
guint shaped : 1;
|
||||
|
||||
GdkEventMask event_mask;
|
||||
};
|
||||
|
||||
@@ -599,6 +599,8 @@ gdk_screen_get_system_colormap (GdkScreen *screen)
|
||||
static GdkColormap *colormap = NULL;
|
||||
GdkColormapPrivateWin32 *private;
|
||||
|
||||
g_return_val_if_fail (screen == _gdk_screen, NULL);
|
||||
|
||||
if (!colormap)
|
||||
{
|
||||
colormap = g_object_new (gdk_colormap_get_type (), NULL);
|
||||
@@ -652,7 +654,7 @@ gdk_colormap_change (GdkColormap *colormap,
|
||||
PALETTEENTRY *pe;
|
||||
int i;
|
||||
|
||||
g_return_if_fail (colormap != NULL);
|
||||
g_return_if_fail (GDK_IS_COLORMAP (colormap));
|
||||
|
||||
cmapp = GDK_WIN32_COLORMAP_DATA (colormap);
|
||||
|
||||
@@ -694,7 +696,7 @@ gdk_colors_alloc (GdkColormap *colormap,
|
||||
gint return_val;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_COLORMAP (colormap), 0);
|
||||
g_return_val_if_fail (GDK_IS_COLORMAP (colormap), FALSE);
|
||||
|
||||
private = GDK_WIN32_COLORMAP_DATA (colormap);
|
||||
|
||||
@@ -1143,6 +1145,7 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
|
||||
|
||||
g_return_val_if_fail (GDK_IS_COLORMAP (colormap), FALSE);
|
||||
g_return_val_if_fail (colors != NULL, FALSE);
|
||||
g_return_val_if_fail (success != NULL, ncolors);
|
||||
|
||||
private = GDK_WIN32_COLORMAP_DATA (colormap);
|
||||
|
||||
@@ -1301,8 +1304,8 @@ gdk_colormap_match_color (GdkColormap *cmap,
|
||||
GdkScreen*
|
||||
gdk_colormap_get_screen (GdkColormap *cmap)
|
||||
{
|
||||
g_return_val_if_fail (cmap != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_COLORMAP (cmap), NULL);
|
||||
|
||||
return gdk_screen_get_default ();
|
||||
return _gdk_screen;
|
||||
}
|
||||
|
||||
|
||||
+91
-46
@@ -136,7 +136,7 @@ gdk_cursor_new_for_display (GdkDisplay *display,
|
||||
{
|
||||
HCURSOR hcursor;
|
||||
|
||||
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
|
||||
hcursor = _gdk_win32_data_to_wcursor (cursor_type);
|
||||
|
||||
@@ -365,7 +365,7 @@ gdk_cursor_new_from_name (GdkDisplay *display,
|
||||
HCURSOR hcursor = NULL;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS(_default_cursors); i++)
|
||||
{
|
||||
@@ -520,7 +520,7 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
{
|
||||
HCURSOR hcursor;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
||||
g_return_val_if_fail (0 <= x && x < gdk_pixbuf_get_width (pixbuf), NULL);
|
||||
g_return_val_if_fail (0 <= y && y < gdk_pixbuf_get_height (pixbuf), NULL);
|
||||
@@ -534,7 +534,7 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
gboolean
|
||||
gdk_display_supports_cursor_alpha (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
g_return_val_if_fail (display == _gdk_display, FALSE);
|
||||
|
||||
return _gdk_win32_pixbuf_to_hicon_supports_alpha ();
|
||||
}
|
||||
@@ -542,7 +542,7 @@ gdk_display_supports_cursor_alpha (GdkDisplay *display)
|
||||
gboolean
|
||||
gdk_display_supports_cursor_color (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
g_return_val_if_fail (display == _gdk_display, FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -550,7 +550,7 @@ gdk_display_supports_cursor_color (GdkDisplay *display)
|
||||
guint
|
||||
gdk_display_get_default_cursor_size (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
g_return_val_if_fail (display == _gdk_display, 0);
|
||||
|
||||
return MIN (GetSystemMetrics (SM_CXCURSOR), GetSystemMetrics (SM_CYCURSOR));
|
||||
}
|
||||
@@ -560,7 +560,7 @@ gdk_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
guint *width,
|
||||
guint *height)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
g_return_if_fail (display == _gdk_display);
|
||||
|
||||
if (width)
|
||||
*width = GetSystemMetrics (SM_CXCURSOR);
|
||||
@@ -613,19 +613,32 @@ create_alpha_bitmap (gint width, gint height, guchar **outdata)
|
||||
}
|
||||
|
||||
static HBITMAP
|
||||
create_color_bitmap (gint width, gint height, guchar **outdata)
|
||||
create_color_bitmap (gint width,
|
||||
gint height,
|
||||
guchar **outdata,
|
||||
gint bits)
|
||||
{
|
||||
BITMAPV4HEADER bi;
|
||||
struct {
|
||||
BITMAPV4HEADER bmiHeader;
|
||||
RGBQUAD bmiColors[2];
|
||||
} bmi;
|
||||
HDC hdc;
|
||||
HBITMAP hBitmap;
|
||||
|
||||
ZeroMemory (&bi, sizeof (BITMAPV4HEADER));
|
||||
bi.bV4Size = sizeof (BITMAPV4HEADER);
|
||||
bi.bV4Width = width;
|
||||
bi.bV4Height = height;
|
||||
bi.bV4Planes = 1;
|
||||
bi.bV4BitCount = 24;
|
||||
bi.bV4V4Compression = BI_RGB;
|
||||
ZeroMemory (&bmi, sizeof (bmi));
|
||||
bmi.bmiHeader.bV4Size = sizeof (BITMAPV4HEADER);
|
||||
bmi.bmiHeader.bV4Width = width;
|
||||
bmi.bmiHeader.bV4Height = height;
|
||||
bmi.bmiHeader.bV4Planes = 1;
|
||||
bmi.bmiHeader.bV4BitCount = bits;
|
||||
bmi.bmiHeader.bV4V4Compression = BI_RGB;
|
||||
|
||||
/* when bits is 1, these will be used.
|
||||
* bmiColors[0] already zeroed from ZeroMemory()
|
||||
*/
|
||||
bmi.bmiColors[1].rgbBlue = 0xFF;
|
||||
bmi.bmiColors[1].rgbGreen = 0xFF;
|
||||
bmi.bmiColors[1].rgbRed = 0xFF;
|
||||
|
||||
hdc = GetDC (NULL);
|
||||
if (!hdc)
|
||||
@@ -633,7 +646,7 @@ create_color_bitmap (gint width, gint height, guchar **outdata)
|
||||
WIN32_GDI_FAILED ("GetDC");
|
||||
return NULL;
|
||||
}
|
||||
hBitmap = CreateDIBSection (hdc, (BITMAPINFO *)&bi, DIB_RGB_COLORS,
|
||||
hBitmap = CreateDIBSection (hdc, (BITMAPINFO *)&bmi, DIB_RGB_COLORS,
|
||||
(PVOID *) outdata, NULL, (DWORD)0);
|
||||
if (hBitmap == NULL)
|
||||
WIN32_GDI_FAILED ("CreateDIBSection");
|
||||
@@ -652,40 +665,55 @@ pixbuf_to_hbitmaps_alpha_winxp (GdkPixbuf *pixbuf,
|
||||
*/
|
||||
HBITMAP hColorBitmap, hMaskBitmap;
|
||||
guchar *indata, *inrow;
|
||||
guchar *outdata, *outrow;
|
||||
guchar *colordata, *colorrow, *maskdata, *maskbyte;
|
||||
gint width, height, i, j, rowstride;
|
||||
guint maskstride, mask_bit;
|
||||
|
||||
width = gdk_pixbuf_get_width (pixbuf); /* width of icon */
|
||||
height = gdk_pixbuf_get_height (pixbuf); /* height of icon */
|
||||
|
||||
hColorBitmap = create_alpha_bitmap (width, height, &outdata);
|
||||
hColorBitmap = create_alpha_bitmap (width, height, &colordata);
|
||||
if (!hColorBitmap)
|
||||
return FALSE;
|
||||
hMaskBitmap = CreateBitmap (width, height, 1, 1, NULL);
|
||||
hMaskBitmap = create_color_bitmap (width, height, &maskdata, 1);
|
||||
if (!hMaskBitmap)
|
||||
{
|
||||
DeleteObject (hColorBitmap);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* rows are always aligned on 4-byte boundarys, but here our pixels are always 4 bytes */
|
||||
/* MSDN says mask rows are aligned to "LONG" boundaries */
|
||||
maskstride = (((width + 31) & ~31) >> 3);
|
||||
|
||||
indata = gdk_pixbuf_get_pixels (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
for (j=0; j<height; j++)
|
||||
{
|
||||
outrow = outdata + 4*j*width;
|
||||
inrow = indata + (height-j-1)*rowstride;
|
||||
colorrow = colordata + 4*j*width;
|
||||
maskbyte = maskdata + j*maskstride;
|
||||
mask_bit = 0x80;
|
||||
inrow = indata + (height-j-1)*rowstride;
|
||||
for (i=0; i<width; i++)
|
||||
{
|
||||
outrow[4*i+0] = inrow[4*i+2];
|
||||
outrow[4*i+1] = inrow[4*i+1];
|
||||
outrow[4*i+2] = inrow[4*i+0];
|
||||
outrow[4*i+3] = inrow[4*i+3];
|
||||
colorrow[4*i+0] = inrow[4*i+2];
|
||||
colorrow[4*i+1] = inrow[4*i+1];
|
||||
colorrow[4*i+2] = inrow[4*i+0];
|
||||
colorrow[4*i+3] = inrow[4*i+3];
|
||||
if (inrow[4*i+3] == 0)
|
||||
maskbyte[0] |= mask_bit; /* turn ON bit */
|
||||
else
|
||||
maskbyte[0] &= ~mask_bit; /* turn OFF bit */
|
||||
mask_bit >>= 1;
|
||||
if (mask_bit == 0)
|
||||
{
|
||||
mask_bit = 0x80;
|
||||
maskbyte++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (color) *color = hColorBitmap;
|
||||
if (mask) *mask = hMaskBitmap;
|
||||
*color = hColorBitmap;
|
||||
*mask = hMaskBitmap;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -700,17 +728,18 @@ pixbuf_to_hbitmaps_normal (GdkPixbuf *pixbuf,
|
||||
*/
|
||||
HBITMAP hColorBitmap, hMaskBitmap;
|
||||
guchar *indata, *inrow;
|
||||
guchar *colordata, *colorrow, *maskdata, *maskrow;
|
||||
guchar *colordata, *colorrow, *maskdata, *maskbyte;
|
||||
gint width, height, i, j, rowstride, nc, bmstride;
|
||||
gboolean has_alpha;
|
||||
guint maskstride, mask_bit;
|
||||
|
||||
width = gdk_pixbuf_get_width (pixbuf); /* width of icon */
|
||||
height = gdk_pixbuf_get_height (pixbuf); /* height of icon */
|
||||
|
||||
hColorBitmap = create_color_bitmap (width, height, &colordata);
|
||||
hColorBitmap = create_color_bitmap (width, height, &colordata, 24);
|
||||
if (!hColorBitmap)
|
||||
return FALSE;
|
||||
hMaskBitmap = create_color_bitmap (width, height, &maskdata);
|
||||
hMaskBitmap = create_color_bitmap (width, height, &maskdata, 1);
|
||||
if (!hMaskBitmap)
|
||||
{
|
||||
DeleteObject (hColorBitmap);
|
||||
@@ -722,6 +751,9 @@ pixbuf_to_hbitmaps_normal (GdkPixbuf *pixbuf,
|
||||
if (bmstride % 4 != 0)
|
||||
bmstride += 4 - (bmstride % 4);
|
||||
|
||||
/* MSDN says mask rows are aligned to "LONG" boundaries */
|
||||
maskstride = (((width + 31) & ~31) >> 3);
|
||||
|
||||
indata = gdk_pixbuf_get_pixels (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
nc = gdk_pixbuf_get_n_channels (pixbuf);
|
||||
@@ -730,27 +762,34 @@ pixbuf_to_hbitmaps_normal (GdkPixbuf *pixbuf,
|
||||
for (j=0; j<height; j++)
|
||||
{
|
||||
colorrow = colordata + j*bmstride;
|
||||
maskrow = maskdata + j*bmstride;
|
||||
inrow = indata + (height-j-1)*rowstride;
|
||||
maskbyte = maskdata + j*maskstride;
|
||||
mask_bit = 0x80;
|
||||
inrow = indata + (height-j-1)*rowstride;
|
||||
for (i=0; i<width; i++)
|
||||
{
|
||||
if (has_alpha && inrow[nc*i+3] < 128)
|
||||
{
|
||||
colorrow[3*i+0] = colorrow[3*i+1] = colorrow[3*i+2] = 0;
|
||||
maskrow[3*i+0] = maskrow[3*i+1] = maskrow[3*i+2] = 255;
|
||||
maskbyte[0] |= mask_bit; /* turn ON bit */
|
||||
}
|
||||
else
|
||||
{
|
||||
colorrow[3*i+0] = inrow[nc*i+2];
|
||||
colorrow[3*i+1] = inrow[nc*i+1];
|
||||
colorrow[3*i+2] = inrow[nc*i+0];
|
||||
maskrow[3*i+0] = maskrow[3*i+1] = maskrow[3*i+2] = 0;
|
||||
maskbyte[0] &= ~mask_bit; /* turn OFF bit */
|
||||
}
|
||||
mask_bit >>= 1;
|
||||
if (mask_bit == 0)
|
||||
{
|
||||
mask_bit = 0x80;
|
||||
maskbyte++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (color) *color = hColorBitmap;
|
||||
if (mask) *mask = hMaskBitmap;
|
||||
*color = hColorBitmap;
|
||||
*mask = hMaskBitmap;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -806,15 +845,21 @@ _gdk_win32_pixbuf_to_hicon_supports_alpha (void)
|
||||
|
||||
if (!is_win_xp_checked)
|
||||
{
|
||||
OSVERSIONINFO version;
|
||||
|
||||
is_win_xp_checked = TRUE;
|
||||
memset (&version, 0, sizeof (version));
|
||||
version.dwOSVersionInfoSize = sizeof (version);
|
||||
is_win_xp = GetVersionEx (&version)
|
||||
&& version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& (version.dwMajorVersion > 5
|
||||
|| (version.dwMajorVersion == 5 && version.dwMinorVersion >= 1));
|
||||
|
||||
if (!G_WIN32_IS_NT_BASED ())
|
||||
is_win_xp = FALSE;
|
||||
else
|
||||
{
|
||||
OSVERSIONINFO version;
|
||||
|
||||
memset (&version, 0, sizeof (version));
|
||||
version.dwOSVersionInfoSize = sizeof (version);
|
||||
is_win_xp = GetVersionEx (&version)
|
||||
&& version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& (version.dwMajorVersion > 5
|
||||
|| (version.dwMajorVersion == 5 && version.dwMinorVersion >= 1));
|
||||
}
|
||||
}
|
||||
return is_win_xp;
|
||||
}
|
||||
|
||||
+22
-129
@@ -236,6 +236,9 @@ gdk_display_open (const gchar *display_name)
|
||||
_gdk_input_init (_gdk_display);
|
||||
_gdk_dnd_init ();
|
||||
|
||||
/* Precalculate display name */
|
||||
(void) gdk_display_get_name (_gdk_display);
|
||||
|
||||
g_signal_emit_by_name (gdk_display_manager_get (),
|
||||
"display_opened", _gdk_display);
|
||||
|
||||
@@ -253,9 +256,13 @@ gdk_display_get_name (GdkDisplay *display)
|
||||
HWINSTA hwinsta = GetProcessWindowStation ();
|
||||
char *window_station_name;
|
||||
DWORD n;
|
||||
DWORD session_id;
|
||||
char *display_name;
|
||||
const char *retval;
|
||||
static const char *display_name_cache = NULL;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
if (display_name_cache != NULL)
|
||||
return display_name_cache;
|
||||
|
||||
n = 0;
|
||||
GetUserObjectInformation (hdesk, UOI_NAME, &dummy, 0, &n);
|
||||
@@ -285,22 +292,22 @@ gdk_display_get_name (GdkDisplay *display)
|
||||
window_station_name = "WinSta0";
|
||||
}
|
||||
|
||||
display_name = g_strdup_printf ("%ld\\%s\\%s",
|
||||
display_name = g_strdup_printf ("%d\\%s\\%s",
|
||||
get_session_id (), window_station_name,
|
||||
desktop_name);
|
||||
|
||||
retval = g_quark_to_string (g_quark_from_string (display_name));
|
||||
GDK_NOTE (MISC, g_print ("gdk_display_get_name: %s\n", display_name));
|
||||
|
||||
g_free (display_name);
|
||||
display_name_cache = display_name;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_display_get_name: %s\n", retval));
|
||||
|
||||
return retval;
|
||||
return display_name_cache;
|
||||
}
|
||||
|
||||
gint
|
||||
gdk_display_get_n_screens (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -308,12 +315,17 @@ GdkScreen *
|
||||
gdk_display_get_screen (GdkDisplay *display,
|
||||
gint screen_num)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
g_return_val_if_fail (screen_num == 0, NULL);
|
||||
|
||||
return _gdk_screen;
|
||||
}
|
||||
|
||||
GdkScreen *
|
||||
gdk_display_get_default_screen (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
return _gdk_screen;
|
||||
}
|
||||
|
||||
@@ -332,133 +344,15 @@ gdk_display_supports_selection_notification (GdkDisplay *display)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static HWND _hwnd_next_viewer = NULL;
|
||||
|
||||
/*
|
||||
* maybe this should be integrated with the default message loop - or maybe not ;-)
|
||||
*/
|
||||
static LRESULT CALLBACK
|
||||
_win32_on_clipboard_change (HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_DESTROY : /* remove us from chain */
|
||||
{
|
||||
ChangeClipboardChain (hwnd, _hwnd_next_viewer);
|
||||
return 0;
|
||||
}
|
||||
case WM_CHANGECBCHAIN :
|
||||
{
|
||||
HWND hwndRemove = (HWND) wparam; /* handle of window being removed */
|
||||
HWND hwndNext = (HWND) lparam; /* handle of next window in chain */
|
||||
if (hwndRemove == _hwnd_next_viewer)
|
||||
_hwnd_next_viewer = hwndNext == hwnd ? NULL : hwndNext;
|
||||
return 0;
|
||||
}
|
||||
case WM_DRAWCLIPBOARD :
|
||||
{
|
||||
/* Create the appropriate gdk events */
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if ((_gdk_debug_flags & GDK_DEBUG_DND) &&
|
||||
OpenClipboard (hwnd))
|
||||
{
|
||||
HWND hwndOwner = GetClipboardOwner ();
|
||||
UINT nFormat = 0;
|
||||
|
||||
g_print ("WM_DRAWCLIPBOARD: owner:%p formats: ", hwndOwner);
|
||||
for (; 0 != (nFormat = EnumClipboardFormats (nFormat));)
|
||||
{
|
||||
g_print ("%s ", _gdk_win32_cf_to_string (nFormat));
|
||||
}
|
||||
g_print ("\n");
|
||||
CloseClipboard ();
|
||||
}
|
||||
#endif
|
||||
/* XXX: generate the apropriate GdkEventOwnerChange ... */
|
||||
|
||||
/* don't break the chain */
|
||||
return PostMessage (_hwnd_next_viewer, message, wparam, lparam);
|
||||
}
|
||||
default :
|
||||
return DefWindowProc (hwnd, message, wparam, lparam);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a hidden window and adds it to the clipboard chain
|
||||
*/
|
||||
HWND
|
||||
_gdk_win32_register_clipboard_notification (void)
|
||||
{
|
||||
WNDCLASS wclass;
|
||||
HWND hwnd;
|
||||
ATOM klass;
|
||||
|
||||
memset (&wclass, 0, sizeof(WNDCLASS));
|
||||
wclass.lpszClassName = "GdkClipboardNotification";
|
||||
wclass.lpfnWndProc = _win32_on_clipboard_change;
|
||||
wclass.hInstance = _gdk_app_hmodule;
|
||||
|
||||
klass = RegisterClass (&wclass);
|
||||
if (!klass)
|
||||
return NULL;
|
||||
|
||||
hwnd = CreateWindow (MAKEINTRESOURCE(klass),
|
||||
NULL, WS_POPUP,
|
||||
0, 0, 0, 0, NULL, NULL,
|
||||
_gdk_app_hmodule, NULL);
|
||||
if (!hwnd)
|
||||
{
|
||||
UnregisterClass (MAKEINTRESOURCE(klass), _gdk_app_hmodule);
|
||||
return NULL;
|
||||
}
|
||||
_hwnd_next_viewer = SetClipboardViewer (hwnd);
|
||||
return hwnd;
|
||||
}
|
||||
|
||||
/*
|
||||
* The whole function would only make sense if the gdk/win32 clipboard
|
||||
* model is rewritten to do delayed rendering. Currently this is only
|
||||
* testcode and as noted in
|
||||
* http://mail.gnome.org/archives/gtk-devel-list/2004-May/msg00113.html
|
||||
* probably not worth bothering ;)
|
||||
*/
|
||||
gboolean
|
||||
gdk_display_request_selection_notification (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
|
||||
{
|
||||
static HWND hwndViewer = NULL;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
GDK_NOTE (DND,
|
||||
g_print ("gdk_display_request_selection_notification (..., %s)",
|
||||
gdk_atom_name (selection)));
|
||||
|
||||
if (GDK_SELECTION_CLIPBOARD == selection)
|
||||
{
|
||||
if (!hwndViewer)
|
||||
{
|
||||
hwndViewer = _gdk_win32_register_clipboard_notification ();
|
||||
GDK_NOTE (DND, g_print (" registered"));
|
||||
}
|
||||
ret = (hwndViewer != NULL);
|
||||
}
|
||||
else if (GDK_SELECTION_PRIMARY == selection)
|
||||
{
|
||||
/* seems to work by default ? */
|
||||
GDK_NOTE (DND, g_print (" by default"));
|
||||
ret = TRUE;
|
||||
}
|
||||
GDK_NOTE (DND, g_print (" -> %s\n", ret ? "TRUE" : "FALSE"));
|
||||
return ret;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -474,5 +368,4 @@ gdk_display_store_clipboard (GdkDisplay *display,
|
||||
GdkAtom *targets,
|
||||
gint n_targets)
|
||||
{
|
||||
/* XXX: implement it (or maybe not as long as we don't support delayed rendering?) */
|
||||
}
|
||||
|
||||
@@ -1592,8 +1592,10 @@ blit_from_pixmap (gboolean use_fg_bg,
|
||||
}
|
||||
|
||||
if (ok)
|
||||
GDI_CALL (BitBlt, (hdc, xdest, ydest, width, height,
|
||||
srcdc, xsrc, ysrc, rop2_to_rop3 (gcwin32->rop2)));
|
||||
if (!BitBlt (hdc, xdest, ydest, width, height,
|
||||
srcdc, xsrc, ysrc, rop2_to_rop3 (gcwin32->rop2)) &&
|
||||
GetLastError () != ERROR_INVALID_HANDLE)
|
||||
WIN32_GDI_FAILED ("BitBlt");
|
||||
|
||||
/* Restore source's color table if necessary */
|
||||
if (ok && newtable_size > 0 && oldtable_size > 0)
|
||||
|
||||
+16
-14
@@ -140,6 +140,7 @@ GPollFD event_poll_fd;
|
||||
|
||||
static GdkWindow *current_window = NULL;
|
||||
static gint current_x, current_y;
|
||||
static gint current_root_x, current_root_y;
|
||||
static UINT msh_mousewheel;
|
||||
static UINT client_message;
|
||||
|
||||
@@ -2420,13 +2421,12 @@ gdk_event_translate (MSG *msg,
|
||||
!(HIWORD (msg->lParam) & KF_ALTDOWN))
|
||||
break;
|
||||
|
||||
/* Let the system handle Alt-Tab, Alt-Space, Alt-Enter and
|
||||
* Alt-F4 unless the keyboard is grabbed.
|
||||
/* Let the system handle Alt-Tab, Alt-Space and Alt-F4 unless
|
||||
* the keyboard is grabbed.
|
||||
*/
|
||||
if (k_grab_window == NULL &&
|
||||
(msg->wParam == VK_TAB ||
|
||||
msg->wParam == VK_SPACE ||
|
||||
msg->wParam == VK_RETURN ||
|
||||
msg->wParam == VK_F4))
|
||||
break;
|
||||
|
||||
@@ -2731,6 +2731,17 @@ gdk_event_translate (MSG *msg,
|
||||
msg->wParam,
|
||||
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
|
||||
|
||||
/* If we haven't moved, don't create any GDK event. Windows
|
||||
* sends WM_MOUSEMOVE messages after a new window is shows under
|
||||
* the mouse, even if the mouse hasn't moved. This disturbs gtk.
|
||||
*/
|
||||
if (msg->pt.x + _gdk_offset_x == current_root_x &&
|
||||
msg->pt.y + _gdk_offset_y == current_root_y)
|
||||
break;
|
||||
|
||||
current_root_x = msg->pt.x + _gdk_offset_x;
|
||||
current_root_y = msg->pt.y + _gdk_offset_y;
|
||||
|
||||
assign_object (&window, find_window_for_mouse_event (window, msg));
|
||||
|
||||
if (p_grab_window != NULL)
|
||||
@@ -2757,15 +2768,6 @@ gdk_event_translate (MSG *msg,
|
||||
if (window != orig_window)
|
||||
translate_mouse_coords (orig_window, window, msg);
|
||||
|
||||
/* If we haven't moved, don't create any event.
|
||||
* Windows sends WM_MOUSEMOVE messages after button presses
|
||||
* even if the mouse doesn't move. This disturbs gtk.
|
||||
*/
|
||||
if (window == current_window &&
|
||||
GET_X_LPARAM (msg->lParam) == current_x &&
|
||||
GET_Y_LPARAM (msg->lParam) == current_y)
|
||||
break;
|
||||
|
||||
event = gdk_event_new (GDK_MOTION_NOTIFY);
|
||||
event->motion.window = window;
|
||||
event->motion.time = _gdk_win32_get_next_tick (msg->time);
|
||||
@@ -2774,8 +2776,8 @@ gdk_event_translate (MSG *msg,
|
||||
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
|
||||
event->motion.x += xoffset;
|
||||
event->motion.y += yoffset;
|
||||
event->motion.x_root = msg->pt.x + _gdk_offset_x;
|
||||
event->motion.y_root = msg->pt.y + _gdk_offset_y;
|
||||
event->motion.x_root = current_root_x;
|
||||
event->motion.y_root = current_root_y;
|
||||
event->motion.axes = NULL;
|
||||
event->motion.state = build_pointer_event_state (msg);
|
||||
event->motion.is_hint = FALSE;
|
||||
|
||||
@@ -48,10 +48,15 @@ UINT _gdk_input_codepage;
|
||||
|
||||
WORD _cf_rtf;
|
||||
WORD _cf_utf8_string;
|
||||
WORD _cf_image_bmp;
|
||||
|
||||
GdkAtom _utf8_string;
|
||||
GdkAtom _gdk_selection_property;
|
||||
GdkAtom _wm_transient_for;
|
||||
GdkAtom _targets;
|
||||
|
||||
GdkAtom _save_targets;
|
||||
GdkAtom _utf8_string;
|
||||
GdkAtom _text;
|
||||
GdkAtom _compound_text;
|
||||
GdkAtom _text_uri_list;
|
||||
GdkAtom _image_bmp;
|
||||
|
||||
@@ -59,10 +64,6 @@ GdkAtom _local_dnd;
|
||||
GdkAtom _gdk_win32_dropfiles;
|
||||
GdkAtom _gdk_ole2_dnd;
|
||||
|
||||
GdkAtom _gdk_selection_property;
|
||||
|
||||
GdkAtom _wm_transient_for;
|
||||
|
||||
gint _gdk_input_ignore_wintab = FALSE;
|
||||
gint _gdk_max_colors = 0;
|
||||
|
||||
|
||||
@@ -127,6 +127,7 @@ _gdk_win32_new_image (GdkVisual *visual,
|
||||
image->width = width;
|
||||
image->height = height;
|
||||
image->depth = depth;
|
||||
image->bits_per_pixel = _gdk_windowing_get_bits_for_depth (gdk_display_get_default (), depth);
|
||||
switch (depth)
|
||||
{
|
||||
case 1:
|
||||
@@ -142,7 +143,7 @@ _gdk_win32_new_image (GdkVisual *visual,
|
||||
image->bpp = 2;
|
||||
break;
|
||||
case 24:
|
||||
image->bpp = 3;
|
||||
image->bpp = image->bits_per_pixel / 8;
|
||||
break;
|
||||
case 32:
|
||||
image->bpp = 4;
|
||||
@@ -157,7 +158,6 @@ _gdk_win32_new_image (GdkVisual *visual,
|
||||
image->bpl = ((width - 1)/8 + 1)*4;
|
||||
else
|
||||
image->bpl = ((width*image->bpp - 1)/4 + 1)*4;
|
||||
image->bits_per_pixel = image->depth;
|
||||
image->mem = bits;
|
||||
|
||||
return image;
|
||||
@@ -423,8 +423,6 @@ _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
|
||||
return 16;
|
||||
|
||||
case 24:
|
||||
return 24;
|
||||
|
||||
case 32:
|
||||
return 32;
|
||||
}
|
||||
|
||||
@@ -110,10 +110,15 @@ _gdk_windowing_init (void)
|
||||
|
||||
_cf_rtf = RegisterClipboardFormat ("Rich Text Format");
|
||||
_cf_utf8_string = RegisterClipboardFormat ("UTF8_STRING");
|
||||
_cf_image_bmp = RegisterClipboardFormat ("image/bmp");
|
||||
|
||||
_utf8_string = gdk_atom_intern ("UTF8_STRING", FALSE);
|
||||
_gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE);
|
||||
_wm_transient_for = gdk_atom_intern ("WM_TRANSIENT_FOR", FALSE);
|
||||
_targets = gdk_atom_intern ("TARGETS", FALSE);
|
||||
|
||||
_save_targets = gdk_atom_intern ("SAVE_TARGETS", FALSE);
|
||||
_utf8_string = gdk_atom_intern ("UTF8_STRING", FALSE);
|
||||
_text = gdk_atom_intern ("TEXT", FALSE);
|
||||
_compound_text = gdk_atom_intern ("COMPOUND_TEXT", FALSE);
|
||||
_text_uri_list = gdk_atom_intern ("text/uri-list", FALSE);
|
||||
_image_bmp = gdk_atom_intern ("image/bmp", FALSE);
|
||||
|
||||
@@ -121,10 +126,6 @@ _gdk_windowing_init (void)
|
||||
_gdk_win32_dropfiles = gdk_atom_intern ("DROPFILES_DND", FALSE);
|
||||
_gdk_ole2_dnd = gdk_atom_intern ("OLE2_DND", FALSE);
|
||||
|
||||
_gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE);
|
||||
|
||||
_wm_transient_for = gdk_atom_intern ("WM_TRANSIENT_FOR", FALSE);
|
||||
|
||||
_gdk_win32_selection_init ();
|
||||
}
|
||||
|
||||
@@ -932,7 +933,7 @@ _gdk_win32_cf_to_string (UINT format)
|
||||
|
||||
switch (format)
|
||||
{
|
||||
#define CASE(x) case CF_##x: return #x
|
||||
#define CASE(x) case CF_##x: return "CF_" #x
|
||||
CASE (BITMAP);
|
||||
CASE (DIB);
|
||||
#ifdef CF_DIBV5
|
||||
@@ -965,7 +966,7 @@ _gdk_win32_cf_to_string (UINT format)
|
||||
format <= CF_PRIVATELAST)
|
||||
return static_printf ("CF_PRIVATE%d", format - CF_PRIVATEFIRST);
|
||||
if (GetClipboardFormatName (format, buf, sizeof (buf)))
|
||||
return static_printf ("%s", buf);
|
||||
return static_printf ("'%s'", buf);
|
||||
else
|
||||
return static_printf ("unk-%#lx", format);
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ gdk_pixmap_new (GdkDrawable *drawable,
|
||||
case 1:
|
||||
case 24:
|
||||
case 32:
|
||||
bmi.bmiHeader.biBitCount = depth;
|
||||
bmi.bmiHeader.biBitCount = _gdk_windowing_get_bits_for_depth (gdk_display_get_default (), depth);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
||||
@@ -356,9 +356,6 @@ HRGN _gdk_win32_gdkregion_to_hrgn (GdkRegion *region,
|
||||
void _gdk_win32_adjust_client_rect (GdkWindow *window,
|
||||
RECT *RECT);
|
||||
|
||||
void _gdk_win32_get_adjusted_client_rect (GdkWindow *window,
|
||||
RECT *RECT);
|
||||
|
||||
void _gdk_selection_property_delete (GdkWindow *);
|
||||
|
||||
void _gdk_dropfiles_store (gchar *data);
|
||||
@@ -472,11 +469,16 @@ extern guint _scancode_rshift;
|
||||
/* Registered clipboard formats */
|
||||
extern WORD _cf_rtf;
|
||||
extern WORD _cf_utf8_string;
|
||||
extern WORD _cf_image_bmp;
|
||||
|
||||
/* GdkAtoms: targets */
|
||||
extern GdkAtom _utf8_string;
|
||||
/* GdkAtoms: properties, targets and types */
|
||||
extern GdkAtom _gdk_selection_property;
|
||||
extern GdkAtom _wm_transient_for;
|
||||
extern GdkAtom _targets;
|
||||
|
||||
extern GdkAtom _save_targets;
|
||||
extern GdkAtom _utf8_string;
|
||||
extern GdkAtom _text;
|
||||
extern GdkAtom _compound_text;
|
||||
extern GdkAtom _text_uri_list;
|
||||
extern GdkAtom _image_bmp;
|
||||
|
||||
@@ -485,10 +487,6 @@ extern GdkAtom _local_dnd;
|
||||
extern GdkAtom _gdk_win32_dropfiles;
|
||||
extern GdkAtom _gdk_ole2_dnd;
|
||||
|
||||
extern GdkAtom _gdk_selection_property;
|
||||
|
||||
extern GdkAtom _wm_transient_for;
|
||||
|
||||
/* Options */
|
||||
extern gboolean _gdk_input_ignore_wintab;
|
||||
extern gint _gdk_max_colors;
|
||||
|
||||
@@ -278,12 +278,17 @@ gdk_property_change (GdkWindow *window,
|
||||
g_free (prop_name),
|
||||
g_free (type_name)));
|
||||
|
||||
/* We should never come here for these types */
|
||||
g_return_if_fail (type != GDK_TARGET_STRING);
|
||||
g_return_if_fail (type != _text);
|
||||
g_return_if_fail (type != _compound_text);
|
||||
g_return_if_fail (type != _save_targets);
|
||||
|
||||
if (property == _gdk_selection_property
|
||||
&& format == 8
|
||||
&& mode == GDK_PROP_MODE_REPLACE)
|
||||
{
|
||||
if ((type == GDK_TARGET_STRING && GetACP () == 1252) ||
|
||||
type == _utf8_string)
|
||||
if (type == _utf8_string)
|
||||
{
|
||||
if (!OpenClipboard (GDK_WINDOW_HWND (window)))
|
||||
{
|
||||
@@ -291,29 +296,17 @@ gdk_property_change (GdkWindow *window,
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == _utf8_string)
|
||||
{
|
||||
/* Check if only ASCII */
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200)
|
||||
break;
|
||||
}
|
||||
else /* if (type == GDK_TARGET_STRING) */
|
||||
{
|
||||
/* Check that no 0200..0240 chars present, as they
|
||||
* differ between ISO-8859-1 and CP1252.
|
||||
*/
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200 && data[i] < 0240)
|
||||
break;
|
||||
}
|
||||
nchars = g_utf8_strlen (data, nelements);
|
||||
|
||||
/* Check if only ASCII */
|
||||
for (i = 0; i < nelements; i++)
|
||||
if (data[i] >= 0200)
|
||||
break;
|
||||
|
||||
if (i == nelements)
|
||||
{
|
||||
/* If UTF-8 and only ASCII, or if STRING (ISO-8859-1)
|
||||
* and system codepage is CP1252, use CF_TEXT and the
|
||||
* data as such.
|
||||
/* If UTF-8 and only ASCII, use CF_TEXT and the data as
|
||||
* such.
|
||||
*/
|
||||
method = SYSTEM_CODEPAGE;
|
||||
size = nelements;
|
||||
@@ -351,8 +344,16 @@ gdk_property_change (GdkWindow *window,
|
||||
|
||||
const guchar *p = data;
|
||||
|
||||
/* WordPad on XP, at least, doesn't seem to grok \uc0
|
||||
* -encoded Unicode characters. Oh well, use \uc1 then,
|
||||
* with a question mark as the "ANSI" stand-in for each
|
||||
* non-ASCII Unicode character. (WordPad for XP? This
|
||||
* code path is for Win9x! Yes, but I don't have Win9x,
|
||||
* so I use XP to test, using the G_WIN32_PRETEND_WIN9X
|
||||
* environment variable.)
|
||||
*/
|
||||
method = RICH_TEXT;
|
||||
rtf = g_string_new ("{\\rtf1\\uc0 ");
|
||||
rtf = g_string_new ("{\\rtf1\\uc1 ");
|
||||
|
||||
while (p < data + nelements)
|
||||
{
|
||||
@@ -374,11 +375,11 @@ gdk_property_change (GdkWindow *window,
|
||||
guchar *q;
|
||||
gint n;
|
||||
|
||||
rtf = g_string_append (rtf, "\\uNNNNN ");
|
||||
rtf->len -= 6; /* five digits and a space */
|
||||
rtf = g_string_append (rtf, "\\uNNNNN ?");
|
||||
rtf->len -= 7; /* five digits a space and a question mark */
|
||||
q = rtf->str + rtf->len;
|
||||
n = g_sprintf (q, "%d ", g_utf8_get_char (p));
|
||||
g_assert (n <= 6);
|
||||
n = g_sprintf (q, "%d ?", g_utf8_get_char (p));
|
||||
g_assert (n <= 7);
|
||||
rtf->len += n;
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
@@ -435,8 +436,10 @@ gdk_property_change (GdkWindow *window,
|
||||
lcidptr = GlobalLock (hlcid);
|
||||
*lcidptr = lcid;
|
||||
GlobalUnlock (hlcid);
|
||||
GDK_NOTE (DND, g_print ("... SetClipboardData(CF_LOCALE,%p)\n",
|
||||
hlcid));
|
||||
if (!SetClipboardData (CF_LOCALE, hlcid))
|
||||
WIN32_API_FAILED ("SetClipboardData (CF_LOCALE)"), ok = FALSE;
|
||||
WIN32_API_FAILED ("SetClipboardData(CF_LOCALE)"), ok = FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -455,8 +458,10 @@ gdk_property_change (GdkWindow *window,
|
||||
guchar *utf8ptr = GlobalLock (hutf8);
|
||||
memmove (utf8ptr, data, nelements);
|
||||
GlobalUnlock (hutf8);
|
||||
GDK_NOTE (DND, g_print ("... SetClipboardData('UTF8_STRING',%p)\n",
|
||||
hutf8));
|
||||
if (!SetClipboardData (_cf_utf8_string, hutf8))
|
||||
WIN32_API_FAILED ("SetClipboardData (UTF8_STRING)");
|
||||
WIN32_API_FAILED ("SetClipboardData('UTF8_STRING')");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -465,6 +470,8 @@ gdk_property_change (GdkWindow *window,
|
||||
}
|
||||
|
||||
GlobalUnlock (hdata);
|
||||
GDK_NOTE (DND, g_print ("... SetClipboardData(%s,%p)\n",
|
||||
_gdk_win32_cf_to_string (cf), hdata));
|
||||
if (ok && !SetClipboardData (cf, hdata))
|
||||
WIN32_API_FAILED ("SetClipboardData"), ok = FALSE;
|
||||
|
||||
@@ -473,6 +480,7 @@ gdk_property_change (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("... delayed rendering\n"));
|
||||
/* Delayed Rendering. We can't assign hdata to the clipboard
|
||||
* here as type may be "image/png", "image/jpg", etc. In
|
||||
* this case there's a further conversion afterwards.
|
||||
|
||||
@@ -47,7 +47,7 @@ gdk_screen_set_default_colormap (GdkScreen *screen,
|
||||
{
|
||||
GdkColormap *old_colormap;
|
||||
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
g_return_if_fail (screen == _gdk_screen);
|
||||
g_return_if_fail (GDK_IS_COLORMAP (colormap));
|
||||
|
||||
old_colormap = default_colormap;
|
||||
@@ -61,7 +61,7 @@ gdk_screen_set_default_colormap (GdkScreen *screen,
|
||||
gint
|
||||
gdk_screen_get_n_monitors (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
g_return_val_if_fail (screen == _gdk_screen, 0);
|
||||
|
||||
return _gdk_num_monitors;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ gdk_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
gint num_monitor,
|
||||
GdkRectangle *dest)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
g_return_if_fail (screen == _gdk_screen);
|
||||
g_return_if_fail (num_monitor < _gdk_num_monitors);
|
||||
g_return_if_fail (num_monitor >= 0);
|
||||
|
||||
@@ -81,7 +81,7 @@ gdk_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
GdkColormap *
|
||||
gdk_screen_get_rgba_colormap (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
g_return_val_if_fail (screen == _gdk_screen, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ gdk_screen_get_rgba_colormap (GdkScreen *screen)
|
||||
GdkVisual *
|
||||
gdk_screen_get_rgba_visual (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||
g_return_val_if_fail (screen == _gdk_screen, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ gdk_screen_get_rgba_visual (GdkScreen *screen)
|
||||
gint
|
||||
gdk_screen_get_number (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
g_return_val_if_fail (screen == _gdk_screen, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -115,5 +115,5 @@ _gdk_windowing_substitute_screen_number (const gchar *display_name,
|
||||
gchar *
|
||||
gdk_screen_make_display_name (GdkScreen *screen)
|
||||
{
|
||||
return gdk_display_get_name (_gdk_display);
|
||||
return g_strdup (gdk_display_get_name (_gdk_display));
|
||||
}
|
||||
|
||||
+160
-98
@@ -201,17 +201,22 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
|
||||
{
|
||||
HWND hwnd;
|
||||
GdkEvent tmp_event;
|
||||
gchar *sel_name;
|
||||
|
||||
g_return_val_if_fail (display == _gdk_display, FALSE);
|
||||
g_return_val_if_fail (selection != GDK_NONE, FALSE);
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
g_print ("gdk_selection_owner_set: %p %#x (%s)\n",
|
||||
(owner ? GDK_WINDOW_HWND (owner) : NULL),
|
||||
(guint) selection, sel_name),
|
||||
g_free (sel_name)));
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
{
|
||||
gchar *sel_name;
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
g_print ("gdk_selection_owner_set_for_display: %p %#x (%s)\n",
|
||||
(owner ? GDK_WINDOW_HWND (owner) : NULL),
|
||||
(guint) selection, sel_name),
|
||||
g_free (sel_name)));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (selection != GDK_SELECTION_CLIPBOARD)
|
||||
{
|
||||
@@ -237,6 +242,7 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
|
||||
return FALSE;
|
||||
|
||||
_ignore_destroy_clipboard = TRUE;
|
||||
GDK_NOTE (DND, g_print ("... EmptyClipboard()\n"));
|
||||
if (!API_CALL (EmptyClipboard, ()))
|
||||
{
|
||||
_ignore_destroy_clipboard = FALSE;
|
||||
@@ -275,28 +281,34 @@ gdk_selection_owner_get_for_display (GdkDisplay *display,
|
||||
GdkAtom selection)
|
||||
{
|
||||
GdkWindow *window;
|
||||
gchar *sel_name;
|
||||
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
g_return_val_if_fail (selection != GDK_NONE, NULL);
|
||||
|
||||
/* Return NULL for CLIPBOARD, because otherwise cut&paste inside the
|
||||
* same application doesn't work. We must pretend to gtk that we
|
||||
* don't have the selection, so that we always fetch it from the
|
||||
* Windows clipboard. See also comments in
|
||||
* gdk_selection_send_notify().
|
||||
*/
|
||||
if (selection == GDK_SELECTION_CLIPBOARD)
|
||||
return NULL;
|
||||
{
|
||||
HWND owner = GetClipboardOwner ();
|
||||
|
||||
if (owner == NULL)
|
||||
return NULL;
|
||||
|
||||
return gdk_win32_handle_table_lookup ((GdkNativeWindow) owner);
|
||||
}
|
||||
|
||||
window = gdk_window_lookup ((GdkNativeWindow) g_hash_table_lookup (sel_owner_table, selection));
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
g_print ("gdk_selection_owner_get: %#x (%s) = %p\n",
|
||||
(guint) selection, sel_name,
|
||||
(window ? GDK_WINDOW_HWND (window) : NULL)),
|
||||
g_free (sel_name)));
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
{
|
||||
gchar *sel_name;
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
g_print ("gdk_selection_owner_get: %#x (%s) = %p\n",
|
||||
(guint) selection, sel_name,
|
||||
(window ? GDK_WINDOW_HWND (window) : NULL)),
|
||||
g_free (sel_name)));
|
||||
}
|
||||
#endif
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -330,8 +342,6 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
{
|
||||
HGLOBAL hdata;
|
||||
GdkAtom property = _gdk_selection_property;
|
||||
gchar *sel_name, *tgt_name;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_if_fail (selection != GDK_NONE);
|
||||
g_return_if_fail (requestor != NULL);
|
||||
@@ -339,15 +349,21 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
if (GDK_WINDOW_DESTROYED (requestor))
|
||||
return;
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
tgt_name = gdk_atom_name (target),
|
||||
g_print ("gdk_selection_convert: %p %#x (%s) %#x (%s)\n",
|
||||
GDK_WINDOW_HWND (requestor),
|
||||
(guint) selection, sel_name,
|
||||
(guint) target, tgt_name),
|
||||
g_free (sel_name),
|
||||
g_free (tgt_name)));
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
{
|
||||
gchar *sel_name, *tgt_name;
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
tgt_name = gdk_atom_name (target),
|
||||
g_print ("gdk_selection_convert: %p %#x (%s) %#x (%s)\n",
|
||||
GDK_WINDOW_HWND (requestor),
|
||||
(guint) selection, sel_name,
|
||||
(guint) target, tgt_name),
|
||||
g_free (sel_name),
|
||||
g_free (tgt_name)));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (selection == GDK_SELECTION_CLIPBOARD && target == _targets)
|
||||
{
|
||||
@@ -400,16 +416,14 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
data[i++] = _image_bmp;
|
||||
|
||||
if (i > 0)
|
||||
_gdk_selection_property_store (requestor, GDK_SELECTION_TYPE_ATOM,
|
||||
32, (guchar *) data, i * sizeof (GdkAtom));
|
||||
_gdk_selection_property_store (requestor, GDK_SELECTION_TYPE_ATOM,
|
||||
32, (guchar *) data, i * sizeof (GdkAtom));
|
||||
else
|
||||
property = GDK_NONE;
|
||||
|
||||
API_CALL (CloseClipboard, ());
|
||||
}
|
||||
else if (selection == GDK_SELECTION_CLIPBOARD &&
|
||||
(target == GDK_TARGET_STRING ||
|
||||
target == _utf8_string))
|
||||
else if (selection == GDK_SELECTION_CLIPBOARD && target == _utf8_string)
|
||||
{
|
||||
/* Converting the CLIPBOARD selection means he wants the
|
||||
* contents of the clipboard. Get the clipboard data, and store
|
||||
@@ -447,14 +461,10 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
p++;
|
||||
}
|
||||
|
||||
data = g_utf16_to_utf8 (wcs, wclen, NULL, NULL, &error);
|
||||
data = g_utf16_to_utf8 (wcs, wclen, NULL, NULL, NULL);
|
||||
g_free (wcs);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
if (data)
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, strlen (data) + 1);
|
||||
GlobalUnlock (hdata);
|
||||
@@ -531,12 +541,10 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
}
|
||||
g_free (wcs);
|
||||
|
||||
data = g_utf16_to_utf8 (wcs2, wclen2, NULL, &length, &error);
|
||||
data = g_utf16_to_utf8 (wcs2, wclen2, NULL, &length, NULL);
|
||||
g_free (wcs2);
|
||||
|
||||
if (!data)
|
||||
g_error_free (error);
|
||||
else
|
||||
if (data)
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
data, length + 1);
|
||||
GlobalUnlock (hdata);
|
||||
@@ -547,14 +555,13 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
|
||||
API_CALL (CloseClipboard, ());
|
||||
}
|
||||
else if (selection == GDK_SELECTION_CLIPBOARD &&
|
||||
target == _image_bmp)
|
||||
else if (selection == GDK_SELECTION_CLIPBOARD && target == _image_bmp)
|
||||
{
|
||||
guchar *data;
|
||||
|
||||
if (!API_CALL (OpenClipboard, (GDK_WINDOW_HWND (requestor))))
|
||||
return;
|
||||
if ((hdata = GetClipboardData (RegisterClipboardFormat ("image/bmp"))) != NULL)
|
||||
if ((hdata = GetClipboardData (_cf_image_bmp)) != NULL)
|
||||
{
|
||||
/* "image/bmp" is the first choice. */
|
||||
guchar *ptr;
|
||||
@@ -613,11 +620,14 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
}
|
||||
else if (selection == GDK_SELECTION_CLIPBOARD)
|
||||
{
|
||||
const char *targetname = gdk_atom_name (target);
|
||||
char *target_name;
|
||||
UINT fmt = 0;
|
||||
|
||||
if (!API_CALL (OpenClipboard, (GDK_WINDOW_HWND (requestor))))
|
||||
return;
|
||||
|
||||
target_name = gdk_atom_name (target);
|
||||
|
||||
/* Check if it's available. In fact, we can simply call
|
||||
* GetClipboardData (RegisterClipboardFormat (targetname)), but
|
||||
* the global custom format ID space is limited,
|
||||
@@ -629,7 +639,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
char sFormat[80];
|
||||
|
||||
if (GetClipboardFormatName (fmt, sFormat, 80) > 0 &&
|
||||
strcmp (sFormat, targetname) == 0)
|
||||
strcmp (sFormat, target_name) == 0)
|
||||
{
|
||||
if ((hdata = GetClipboardData (fmt)) != NULL)
|
||||
{
|
||||
@@ -641,7 +651,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
{
|
||||
length = GlobalSize (hdata);
|
||||
|
||||
GDK_NOTE (DND, g_print ("... %s: %d bytes\n", targetname, length));
|
||||
GDK_NOTE (DND, g_print ("... %s: %d bytes\n", target_name, length));
|
||||
|
||||
_gdk_selection_property_store (requestor, target, 8,
|
||||
g_memdup (ptr, length), length);
|
||||
@@ -651,6 +661,7 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
}
|
||||
}
|
||||
}
|
||||
g_free (target_name);
|
||||
API_CALL (CloseClipboard, ());
|
||||
}
|
||||
else if (selection == _gdk_win32_dropfiles)
|
||||
@@ -746,22 +757,26 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
GdkAtom property,
|
||||
guint32 time)
|
||||
{
|
||||
gchar *sel_name, *tgt_name, *prop_name;
|
||||
|
||||
g_return_if_fail (display == _gdk_display);
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
tgt_name = gdk_atom_name (target),
|
||||
prop_name = gdk_atom_name (property),
|
||||
g_print ("gdk_selection_send_notify: %#x %#x (%s) %#x (%s) %#x (%s)\n",
|
||||
requestor,
|
||||
(guint) selection, sel_name,
|
||||
(guint) target, tgt_name,
|
||||
(guint) property, prop_name),
|
||||
g_free (sel_name),
|
||||
g_free (tgt_name),
|
||||
g_free (prop_name)));
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
{
|
||||
gchar *sel_name, *tgt_name, *prop_name;
|
||||
|
||||
GDK_NOTE (DND,
|
||||
(sel_name = gdk_atom_name (selection),
|
||||
tgt_name = gdk_atom_name (target),
|
||||
prop_name = gdk_atom_name (property),
|
||||
g_print ("gdk_selection_send_notify_for_display: %p %#x (%s) %#x (%s) %#x (%s)\n",
|
||||
(gpointer) requestor,
|
||||
(guint) selection, sel_name,
|
||||
(guint) target, tgt_name,
|
||||
(guint) property, prop_name),
|
||||
g_free (sel_name),
|
||||
g_free (tgt_name),
|
||||
g_free (prop_name)));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* It's hard to say whether implementing this actually is of any use
|
||||
@@ -776,38 +791,41 @@ gdk_text_property_to_text_list_for_display (GdkDisplay *display,
|
||||
gint length,
|
||||
gchar ***list)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gchar *enc_name;
|
||||
gchar *result;
|
||||
const gchar *charset;
|
||||
const gchar *source_charset = NULL;
|
||||
gchar *source_charset;
|
||||
|
||||
g_return_val_if_fail (display == _gdk_display, 0);
|
||||
|
||||
GDK_NOTE (DND, (enc_name = gdk_atom_name (encoding),
|
||||
g_print ("gdk_text_property_to_text_list: %s %d %.20s %d\n",
|
||||
enc_name, format, text, length),
|
||||
g_free (enc_name)));
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
{
|
||||
gchar *enc_name;
|
||||
|
||||
GDK_NOTE (DND, (enc_name = gdk_atom_name (encoding),
|
||||
g_print ("gdk_text_property_to_text_list_for_display: %s %d %.20s %d\n",
|
||||
enc_name, format, text, length),
|
||||
g_free (enc_name)));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!list)
|
||||
return 0;
|
||||
|
||||
if (encoding == GDK_TARGET_STRING)
|
||||
source_charset = "ISO-8859-1";
|
||||
source_charset = g_strdup ("ISO-8859-1");
|
||||
else if (encoding == _utf8_string)
|
||||
source_charset = "UTF-8";
|
||||
source_charset = g_strdup ("UTF-8");
|
||||
else
|
||||
source_charset = gdk_atom_name (encoding);
|
||||
|
||||
g_get_charset (&charset);
|
||||
|
||||
result = g_convert (text, length, charset, source_charset,
|
||||
NULL, NULL, &error);
|
||||
NULL, NULL, NULL);
|
||||
g_free (source_charset);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
g_error_free (error);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
|
||||
*list = g_new (gchar *, 1);
|
||||
**list = result;
|
||||
@@ -915,7 +933,10 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("gdk_text_property_to_utf8_list_for_display: encoding %s not handled\n", gdk_atom_name (encoding));
|
||||
gchar *enc_name = gdk_atom_name (encoding);
|
||||
|
||||
g_warning ("gdk_text_property_to_utf8_list_for_display: encoding %s not handled\n", enc_name);
|
||||
g_free (enc_name);
|
||||
|
||||
if (list)
|
||||
*list = NULL;
|
||||
@@ -1008,12 +1029,32 @@ gdk_win32_selection_add_targets (GdkWindow *owner,
|
||||
GdkAtom *targets)
|
||||
{
|
||||
HWND hwnd;
|
||||
const gchar *target_name;
|
||||
guint formatid;
|
||||
gint i;
|
||||
GSList *convertable_formats, *format;
|
||||
gboolean has_set_dib = FALSE, has_real_dib = FALSE;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (_gdk_debug_flags & GDK_DEBUG_DND)
|
||||
{
|
||||
gchar *sel_name = gdk_atom_name (selection);
|
||||
|
||||
g_print ("gdk_win32_selection_add_targets: %p: %s: ",
|
||||
owner ? GDK_WINDOW_HWND (owner) : NULL,
|
||||
sel_name);
|
||||
g_free (sel_name);
|
||||
|
||||
for (i = 0; i < n_targets; i++)
|
||||
{
|
||||
gchar *tgt_name = gdk_atom_name (targets[i]);
|
||||
|
||||
g_print ("%s ", tgt_name);
|
||||
g_free (tgt_name);
|
||||
}
|
||||
g_print ("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (selection != GDK_SELECTION_CLIPBOARD)
|
||||
return;
|
||||
|
||||
@@ -1030,16 +1071,28 @@ gdk_win32_selection_add_targets (GdkWindow *owner,
|
||||
convertable_formats = gdk_pixbuf_get_formats ();
|
||||
for (i = 0; i < n_targets; ++i)
|
||||
{
|
||||
if (targets[i] == _utf8_string)
|
||||
gchar *target_name;
|
||||
|
||||
if (targets[i] == _utf8_string ||
|
||||
targets[i] == GDK_TARGET_STRING ||
|
||||
targets[i] == _text ||
|
||||
targets[i] == _compound_text ||
|
||||
targets[i] == _save_targets)
|
||||
continue;
|
||||
|
||||
target_name = gdk_atom_name (targets[i]);
|
||||
if (!(formatid = RegisterClipboardFormat (target_name))) {
|
||||
WIN32_API_FAILED ("RegisterClipboardFormat");
|
||||
API_CALL (CloseClipboard, ());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(formatid = RegisterClipboardFormat (target_name)))
|
||||
{
|
||||
WIN32_API_FAILED ("RegisterClipboardFormat");
|
||||
API_CALL (CloseClipboard, ());
|
||||
g_free (target_name);
|
||||
return;
|
||||
}
|
||||
g_hash_table_replace (_format_atom_table, GINT_TO_POINTER (formatid), targets[i]);
|
||||
|
||||
GDK_NOTE (DND, g_print ("... SetClipboardData(%s,NULL)\n",
|
||||
_gdk_win32_cf_to_string (formatid)));
|
||||
SetClipboardData (formatid, NULL);
|
||||
|
||||
/* We should replace the previous image format associated with
|
||||
@@ -1054,11 +1107,14 @@ gdk_win32_selection_add_targets (GdkWindow *owner,
|
||||
g_hash_table_replace (_format_atom_table,
|
||||
GINT_TO_POINTER (CF_DIB),
|
||||
targets[i]);
|
||||
if (!has_set_dib) {
|
||||
SetClipboardData (CF_DIB, NULL);
|
||||
has_set_dib = TRUE;
|
||||
}
|
||||
if (!has_set_dib)
|
||||
{
|
||||
GDK_NOTE (DND, g_print ("... SetClipboardData(CF_DIB,NULL)\n"));
|
||||
SetClipboardData (CF_DIB, NULL);
|
||||
has_set_dib = TRUE;
|
||||
}
|
||||
has_real_dib = TRUE;
|
||||
g_free (target_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1074,12 +1130,14 @@ gdk_win32_selection_add_targets (GdkWindow *owner,
|
||||
g_hash_table_replace (_format_atom_table,
|
||||
GINT_TO_POINTER (CF_DIB),
|
||||
targets[i]);
|
||||
GDK_NOTE (DND, g_print ("... SetClipboardData(CF_DIB,NULL)\n"));
|
||||
SetClipboardData (CF_DIB, NULL);
|
||||
has_set_dib = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
g_free (target_name);
|
||||
}
|
||||
g_slist_free (convertable_formats);
|
||||
|
||||
@@ -1096,7 +1154,7 @@ _gdk_win32_selection_convert_to_dib (HGLOBAL hdata,
|
||||
{
|
||||
GdkPixbufLoader *loader;
|
||||
GdkPixbuf *pixbuf;
|
||||
const gchar *target_name;
|
||||
gchar *target_name;
|
||||
guchar *ptr;
|
||||
gchar *bmp_buf;
|
||||
gsize size;
|
||||
@@ -1115,14 +1173,16 @@ _gdk_win32_selection_convert_to_dib (HGLOBAL hdata,
|
||||
/* No conversion is needed, just strip the BITMAPFILEHEADER */
|
||||
HGLOBAL hdatanew;
|
||||
|
||||
g_free (target_name);
|
||||
size = GlobalSize (hdata) - 1 - sizeof (BITMAPFILEHEADER);
|
||||
ptr = GlobalLock (hdata);
|
||||
memmove (ptr, ptr + sizeof (BITMAPFILEHEADER), size);
|
||||
GlobalUnlock (hdata);
|
||||
if (!(hdatanew = GlobalReAlloc (hdata, size, 0))) {
|
||||
WIN32_API_FAILED ("GlobalReAlloc");
|
||||
GlobalFree (hdata); /* the old hdata is not freed if error */
|
||||
}
|
||||
if (!(hdatanew = GlobalReAlloc (hdata, size, 0)))
|
||||
{
|
||||
WIN32_API_FAILED ("GlobalReAlloc");
|
||||
GlobalFree (hdata); /* the old hdata is not freed if error */
|
||||
}
|
||||
return hdatanew;
|
||||
}
|
||||
|
||||
@@ -1133,8 +1193,10 @@ _gdk_win32_selection_convert_to_dib (HGLOBAL hdata,
|
||||
if (!(loader = gdk_pixbuf_loader_new_with_mime_type (target_name, NULL)))
|
||||
{
|
||||
GlobalFree (hdata);
|
||||
g_free (target_name);
|
||||
return NULL;
|
||||
}
|
||||
g_free (target_name);
|
||||
|
||||
ptr = GlobalLock (hdata);
|
||||
ok = gdk_pixbuf_loader_write (loader, ptr, GlobalSize (hdata) - 1, NULL) &&
|
||||
|
||||
@@ -246,6 +246,7 @@ _gdk_visual_init (void)
|
||||
}
|
||||
else if (bitspixel == 24 || bitspixel == 32)
|
||||
{
|
||||
bitspixel = 24;
|
||||
system_visual->type = GDK_VISUAL_TRUE_COLOR;
|
||||
system_visual->red_mask = 0x00FF0000;
|
||||
system_visual->green_mask = 0x0000FF00;
|
||||
|
||||
+250
-259
File diff suppressed because it is too large
Load Diff
@@ -84,6 +84,8 @@ struct _GdkWindowImplWin32
|
||||
GdkGeometry hints;
|
||||
|
||||
gboolean extension_events_selected;
|
||||
|
||||
GdkWindowTypeHint type_hint;
|
||||
};
|
||||
|
||||
struct _GdkWindowImplWin32Class
|
||||
|
||||
+8
-1
@@ -626,6 +626,9 @@ _gdk_x11_get_window_child_info (GdkDisplay *display,
|
||||
else
|
||||
wm_state_atom = None;
|
||||
|
||||
state.children = NULL;
|
||||
state.nchildren = 0;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
result = list_children_and_wm_state (dpy, window,
|
||||
win_has_wm_state ? wm_state_atom : None,
|
||||
@@ -633,12 +636,16 @@ _gdk_x11_get_window_child_info (GdkDisplay *display,
|
||||
&state.children, &state.nchildren);
|
||||
gdk_error_trap_pop ();
|
||||
if (!result)
|
||||
return FALSE;
|
||||
{
|
||||
g_free (state.children);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (has_wm_state)
|
||||
{
|
||||
if (win_has_wm_state)
|
||||
*win_has_wm_state = TRUE;
|
||||
g_free (state.children);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1371,7 +1371,7 @@ gdkx_colormap_get (Colormap xcolormap)
|
||||
GdkColormap *colormap;
|
||||
|
||||
if (xcolormap == DefaultColormap (GDK_SCREEN_XDISPLAY (screen),
|
||||
GDK_SCREEN_XNUMBER (screen)));
|
||||
GDK_SCREEN_XNUMBER (screen)))
|
||||
return g_object_ref (gdk_screen_get_system_colormap (screen));
|
||||
|
||||
colormap = gdk_colormap_lookup (screen, xcolormap);
|
||||
|
||||
@@ -446,7 +446,8 @@ update_cursor (gpointer key,
|
||||
/**
|
||||
* gdk_x11_display_set_cursor_theme:
|
||||
* @display: a #GdkDisplay
|
||||
* @theme: the name of the cursor theme to use
|
||||
* @theme: the name of the cursor theme to use, or %NULL to unset
|
||||
* a previously set value
|
||||
* @size: the cursor size to use
|
||||
*
|
||||
* Sets the cursor theme from which the images for cursor
|
||||
@@ -481,8 +482,9 @@ gdk_x11_display_set_cursor_theme (GdkDisplay *display,
|
||||
old_theme = XcursorGetTheme (xdisplay);
|
||||
old_size = XcursorGetDefaultSize (xdisplay);
|
||||
|
||||
if (old_size == size &&
|
||||
old_theme && strcmp (old_theme, theme) == 0)
|
||||
if (old_size == size &&
|
||||
(old_theme == theme ||
|
||||
(old_theme && theme && strcmp (old_theme, theme) == 0)))
|
||||
return;
|
||||
|
||||
theme_serial++;
|
||||
|
||||
@@ -136,7 +136,7 @@ static GList *contexts;
|
||||
const static struct {
|
||||
const char *atom_name;
|
||||
GdkFilterFunc func;
|
||||
} const xdnd_filters[] = {
|
||||
} xdnd_filters[] = {
|
||||
{ "XdndEnter", xdnd_enter_filter },
|
||||
{ "XdndLeave", xdnd_leave_filter },
|
||||
{ "XdndPosition", xdnd_position_filter },
|
||||
|
||||
+21
-5
@@ -244,12 +244,28 @@ get_symbol (const KeySym *syms,
|
||||
gint index;
|
||||
|
||||
index = KEYSYM_INDEX(keymap_x11, group, level);
|
||||
if (index > keymap_x11->keysyms_per_keycode)
|
||||
if (index >= keymap_x11->keysyms_per_keycode)
|
||||
return NoSymbol;
|
||||
|
||||
return syms[index];
|
||||
}
|
||||
|
||||
static void
|
||||
set_symbol (KeySym *syms,
|
||||
GdkKeymapX11 *keymap_x11,
|
||||
gint group,
|
||||
gint level,
|
||||
KeySym sym)
|
||||
{
|
||||
gint index;
|
||||
|
||||
index = KEYSYM_INDEX(keymap_x11, group, level);
|
||||
if (index >= keymap_x11->keysyms_per_keycode)
|
||||
return;
|
||||
|
||||
syms[index] = sym;
|
||||
}
|
||||
|
||||
static void
|
||||
update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
{
|
||||
@@ -295,7 +311,7 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
for (i = 0 ; i < 2 ; i++)
|
||||
{
|
||||
if (get_symbol (syms, keymap_x11, i, 0) == GDK_Tab)
|
||||
syms[KEYSYM_INDEX (keymap_x11, i, 1)] = GDK_ISO_Left_Tab;
|
||||
set_symbol (syms, keymap_x11, i, 1, GDK_ISO_Left_Tab);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -310,8 +326,8 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
|
||||
gdk_keyval_convert_case (get_symbol (syms, keymap_x11, 0, 0), &lower, &upper);
|
||||
if (lower != upper)
|
||||
{
|
||||
syms[KEYSYM_INDEX (keymap_x11, 0, 0)] = lower;
|
||||
syms[KEYSYM_INDEX (keymap_x11, 0, 1)] = upper;
|
||||
set_symbol (syms, keymap_x11, 0, 0, lower);
|
||||
set_symbol (syms, keymap_x11, 0, 1, upper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1103,7 +1119,7 @@ MyEnhancedXkbTranslateKeyCode(register XkbDescPtr xkb,
|
||||
|
||||
/* ---- End stuff GDK adds to the original Xlib version ---- */
|
||||
|
||||
return (syms[col]!=NoSymbol);
|
||||
return (syms[col] != NoSymbol);
|
||||
}
|
||||
#endif /* HAVE_XKB */
|
||||
|
||||
|
||||
@@ -530,11 +530,8 @@ gdk_property_get (GdkWindow *window,
|
||||
*/
|
||||
get_length = length + 3;
|
||||
if (get_length > G_MAXLONG)
|
||||
{
|
||||
g_warning ("gdk_property_get(): length value has wrapped in calculation "
|
||||
"(did you pass G_MAXLONG?)");
|
||||
get_length = G_MAXLONG;
|
||||
}
|
||||
get_length = G_MAXLONG;
|
||||
|
||||
/* To fail, either the user passed 0 or G_MAXULONG */
|
||||
get_length = get_length / 4;
|
||||
if (get_length == 0)
|
||||
|
||||
+28
-4
@@ -3685,6 +3685,7 @@ gdk_window_shape_combine_mask (GdkWindow *window,
|
||||
GdkBitmap *mask,
|
||||
gint x, gint y)
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
Pixmap pixmap;
|
||||
gint xoffset, yoffset;
|
||||
|
||||
@@ -3707,12 +3708,16 @@ gdk_window_shape_combine_mask (GdkWindow *window,
|
||||
if (mask)
|
||||
{
|
||||
pixmap = GDK_PIXMAP_XID (mask);
|
||||
|
||||
private->shaped = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
pixmap = None;
|
||||
|
||||
private->shaped = FALSE;
|
||||
}
|
||||
|
||||
XShapeCombineMask (GDK_WINDOW_XDISPLAY (window),
|
||||
@@ -3754,7 +3759,8 @@ gdk_window_shape_combine_region (GdkWindow *window,
|
||||
GdkRegion *shape_region,
|
||||
gint offset_x,
|
||||
gint offset_y)
|
||||
{
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
gint xoffset, yoffset;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -3783,6 +3789,8 @@ gdk_window_shape_combine_region (GdkWindow *window,
|
||||
gint n_rects = 0;
|
||||
XRectangle *xrects = NULL;
|
||||
|
||||
private->shaped = TRUE;
|
||||
|
||||
_gdk_region_get_xrectangles (shape_region,
|
||||
0, 0,
|
||||
&xrects, &n_rects);
|
||||
@@ -3959,6 +3967,12 @@ gdk_x11_window_set_user_time (GdkWindow *window,
|
||||
toplevel->user_time = timestamp_long;
|
||||
}
|
||||
|
||||
#define GDK_SELECTION_MAX_SIZE(display) \
|
||||
MIN(262144, \
|
||||
XExtendedMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) == 0 \
|
||||
? XMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) - 100 \
|
||||
: XExtendedMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) - 100)
|
||||
|
||||
/**
|
||||
* gdk_window_set_icon_list:
|
||||
* @window: The #GdkWindow toplevel window to set the icon of.
|
||||
@@ -3987,6 +4001,7 @@ gdk_window_set_icon_list (GdkWindow *window,
|
||||
gint x, y;
|
||||
gint n_channels;
|
||||
GdkDisplay *display;
|
||||
gint n;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -3997,7 +4012,7 @@ gdk_window_set_icon_list (GdkWindow *window,
|
||||
|
||||
l = pixbufs;
|
||||
size = 0;
|
||||
|
||||
n = 0;
|
||||
while (l)
|
||||
{
|
||||
pixbuf = l->data;
|
||||
@@ -4006,8 +4021,16 @@ gdk_window_set_icon_list (GdkWindow *window,
|
||||
width = gdk_pixbuf_get_width (pixbuf);
|
||||
height = gdk_pixbuf_get_height (pixbuf);
|
||||
|
||||
/* silently ignore overlarge icons */
|
||||
if (size + 2 + width * height > GDK_SELECTION_MAX_SIZE(display))
|
||||
{
|
||||
g_warning ("gdk_window_set_icon_list: icons too large");
|
||||
break;
|
||||
}
|
||||
|
||||
n++;
|
||||
size += 2 + width * height;
|
||||
|
||||
|
||||
l = g_list_next (l);
|
||||
}
|
||||
|
||||
@@ -4015,7 +4038,7 @@ gdk_window_set_icon_list (GdkWindow *window,
|
||||
|
||||
l = pixbufs;
|
||||
p = data;
|
||||
while (l)
|
||||
while (l && n > 0)
|
||||
{
|
||||
pixbuf = l->data;
|
||||
|
||||
@@ -4048,6 +4071,7 @@ gdk_window_set_icon_list (GdkWindow *window,
|
||||
}
|
||||
|
||||
l = g_list_next (l);
|
||||
n--;
|
||||
}
|
||||
|
||||
if (size > 0)
|
||||
|
||||
@@ -201,9 +201,9 @@ init_xft_settings (GdkScreen *screen)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
screen_x11->xft_rgba = subpixel;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!get_double_default (xdisplay, "dpi", &dpi_double))
|
||||
|
||||
+3
-6
@@ -7,17 +7,14 @@ DEVZIP=/tmp/gtk+-dev-@GTK_VERSION@-`date +%Y%m%d`.zip
|
||||
cd @prefix@
|
||||
rm $ZIP
|
||||
|
||||
DLLDIR=lib
|
||||
[ -f bin/libgdk_pixbuf-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll ] && DLLDIR=bin
|
||||
|
||||
zip $ZIP -@ <<EOF
|
||||
COPYING.LIB-2
|
||||
etc/gtk-2.0/gdk-pixbuf.loaders
|
||||
etc/gtk-2.0/gtkrc
|
||||
etc/gtk-2.0/gtk.immodules
|
||||
$DLLDIR/libgdk_pixbuf-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
$DLLDIR/libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
$DLLDIR/libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
bin/libgdk_pixbuf-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
bin/libgdk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
bin/libgtk-win32-@GTK_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll
|
||||
EOF
|
||||
|
||||
zip $ZIP lib/gtk-2.0/@GTK_BINARY_VERSION@/loaders/*.dll lib/gtk-2.0/@GTK_BINARY_VERSION@/immodules/*.dll lib/gtk-2.0/@GTK_BINARY_VERSION@/engines/*.dll
|
||||
|
||||
+2
-2
@@ -636,7 +636,7 @@ gtkmarshal.c: @REBUILD@ gtkmarshal.list
|
||||
gtktypebuiltins.h: stamp-gtktypebuiltins.h
|
||||
@true
|
||||
stamp-gtktypebuiltins.h: @REBUILD@ $(gtk_public_h_sources) Makefile
|
||||
( cd $(srcdir) && glib-mkenums \
|
||||
( cd $(srcdir) && $(GLIB_MKENUMS) \
|
||||
--fhead "#ifndef __GTK_TYPE_BUILTINS_H__\n#define __GTK_TYPE_BUILTINS_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
|
||||
--fprod "/* enumerations from \"@filename@\" */\n" \
|
||||
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GTK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
|
||||
@@ -646,7 +646,7 @@ stamp-gtktypebuiltins.h: @REBUILD@ $(gtk_public_h_sources) Makefile
|
||||
&& rm -f xgen-gtbh \
|
||||
&& echo timestamp > $(@F)
|
||||
gtktypebuiltins.c: @REBUILD@ $(gtk_public_h_sources) Makefile
|
||||
( cd $(srcdir) && glib-mkenums \
|
||||
( cd $(srcdir) && $(GLIB_MKENUMS) \
|
||||
--fhead "#undef GTK_DISABLE_DEPRECATED\n#define GTK_ENABLE_BROKEN\n#include \"gtk.h\"\n#include \"gtkprivate.h\"\n#include \"gtkalias.h\"\n" \
|
||||
--ftail "#define __GTK_TYPE_BUILTINS_C__\n#include \"gtkaliasdef.c\"\n" \
|
||||
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||
|
||||
@@ -438,7 +438,7 @@ static void
|
||||
gtk_about_dialog_init (GtkAboutDialog *about)
|
||||
{
|
||||
GtkAboutDialogPrivate *priv;
|
||||
GtkWidget *vbox, *hbox, *button;
|
||||
GtkWidget *vbox, *hbox, *button, *image;
|
||||
|
||||
/* Data */
|
||||
priv = GTK_ABOUT_DIALOG_GET_PRIVATE (about);
|
||||
@@ -506,7 +506,9 @@ gtk_about_dialog_init (GtkAboutDialog *about)
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (about), GTK_RESPONSE_CLOSE);
|
||||
|
||||
/* Add the credits button */
|
||||
button = gtk_button_new_from_stock (_("C_redits"));
|
||||
button = gtk_button_new_with_mnemonic (_("C_redits"));
|
||||
image = gtk_image_new_from_stock (GTK_STOCK_ABOUT, GTK_ICON_SIZE_BUTTON);
|
||||
gtk_button_set_image (GTK_BUTTON (button), image);
|
||||
gtk_widget_set_no_show_all (button, TRUE);
|
||||
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (about)->action_area),
|
||||
button, FALSE, TRUE, 0);
|
||||
|
||||
+8
-4
@@ -745,7 +745,7 @@ gtk_action_sync_button_stock_id (GtkAction *action,
|
||||
GtkWidget *proxy)
|
||||
{
|
||||
g_object_set (G_OBJECT (proxy),
|
||||
"stock-id",
|
||||
"label",
|
||||
action->private_data->stock_id,
|
||||
NULL);
|
||||
}
|
||||
@@ -949,13 +949,14 @@ connect_proxy (GtkAction *action,
|
||||
{
|
||||
/* synchronise stock-id */
|
||||
g_object_set (proxy,
|
||||
"stock-id", action->private_data->stock_id,
|
||||
"label", action->private_data->stock_id,
|
||||
NULL);
|
||||
g_signal_connect_object (action, "notify::stock-id",
|
||||
G_CALLBACK (gtk_action_sync_button_stock_id),
|
||||
proxy, 0);
|
||||
}
|
||||
else if (GTK_IS_LABEL(GTK_BIN(proxy)->child))
|
||||
else if (GTK_BIN (proxy)->child == NULL ||
|
||||
GTK_IS_LABEL (GTK_BIN (proxy)->child))
|
||||
{
|
||||
/* synchronise the label */
|
||||
g_object_set (proxy,
|
||||
@@ -999,6 +1000,9 @@ disconnect_proxy (GtkAction *action,
|
||||
g_signal_handlers_disconnect_by_func (action,
|
||||
G_CALLBACK (gtk_action_sync_sensitivity),
|
||||
proxy);
|
||||
g_signal_handlers_disconnect_by_func (action,
|
||||
G_CALLBACK (gtk_action_sync_visible),
|
||||
proxy);
|
||||
g_signal_handlers_disconnect_by_func (action,
|
||||
G_CALLBACK (gtk_action_sync_property),
|
||||
proxy);
|
||||
@@ -1500,7 +1504,7 @@ gtk_action_get_accel_path (GtkAction *action)
|
||||
* Since: 2.8
|
||||
*
|
||||
* Returns: the accel closure for this action. The returned closure is
|
||||
* owned by GTK+ must and not be unrefed or modified.
|
||||
* owned by GTK+ and must not be unreffed or modified.
|
||||
*/
|
||||
GClosure *
|
||||
gtk_action_get_accel_closure (GtkAction *action)
|
||||
|
||||
+6
-1
@@ -1845,8 +1845,13 @@ void
|
||||
gtk_button_set_image (GtkButton *button,
|
||||
GtkWidget *image)
|
||||
{
|
||||
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (button);
|
||||
GtkButtonPrivate *priv;
|
||||
|
||||
g_return_if_fail (GTK_IS_BUTTON (button));
|
||||
g_return_if_fail (image == NULL || GTK_IS_WIDGET (image));
|
||||
|
||||
priv = GTK_BUTTON_GET_PRIVATE (button);
|
||||
|
||||
priv->image = image;
|
||||
priv->image_is_stock = (image == NULL);
|
||||
|
||||
|
||||
+73
-5
@@ -40,6 +40,13 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
#undef GTK_DISABLE_DEPRECATED
|
||||
@@ -562,11 +569,22 @@ gtk_calendar_init (GtkCalendar *calendar)
|
||||
struct tm *tm;
|
||||
gint i;
|
||||
char buffer[255];
|
||||
#ifdef G_OS_WIN32
|
||||
wchar_t wbuffer[100];
|
||||
#else
|
||||
time_t tmp_time;
|
||||
#endif
|
||||
GtkCalendarPrivate *priv;
|
||||
gchar *year_before;
|
||||
#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
|
||||
gchar *langinfo;
|
||||
gint week_1stday = 0;
|
||||
gint first_weekday = 1;
|
||||
guint week_origin;
|
||||
#else
|
||||
gchar *week_start;
|
||||
|
||||
#endif
|
||||
|
||||
priv = calendar->priv = G_TYPE_INSTANCE_GET_PRIVATE (calendar,
|
||||
GTK_TYPE_CALENDAR,
|
||||
GtkCalendarPrivate);
|
||||
@@ -576,17 +594,57 @@ gtk_calendar_init (GtkCalendar *calendar)
|
||||
if (!default_abbreviated_dayname[0])
|
||||
for (i=0; i<7; i++)
|
||||
{
|
||||
#ifndef G_OS_WIN32
|
||||
tmp_time= (i+3)*86400;
|
||||
strftime ( buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
|
||||
default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
||||
#else
|
||||
if (G_WIN32_HAVE_WIDECHAR_API ())
|
||||
{
|
||||
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SABBREVDAYNAME1 + (i+6)%7,
|
||||
wbuffer, G_N_ELEMENTS (wbuffer)))
|
||||
default_abbreviated_dayname[i] = g_strdup_printf ("(%d)", i);
|
||||
else
|
||||
default_abbreviated_dayname[i] = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GetLocaleInfoA (GetThreadLocale (),
|
||||
(LOCALE_SABBREVDAYNAME1 + (i+6)%7) | LOCALE_USE_CP_ACP,
|
||||
buffer, G_N_ELEMENTS (buffer)))
|
||||
default_abbreviated_dayname[i] = g_strdup_printf ("(%d)", i);
|
||||
else
|
||||
default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!default_monthname[0])
|
||||
for (i=0; i<12; i++)
|
||||
{
|
||||
#ifndef G_OS_WIN32
|
||||
tmp_time=i*2764800;
|
||||
strftime ( buffer, sizeof (buffer), "%B", gmtime (&tmp_time));
|
||||
default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
||||
#else
|
||||
if (G_WIN32_HAVE_WIDECHAR_API ())
|
||||
{
|
||||
if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SMONTHNAME1 + i,
|
||||
wbuffer, G_N_ELEMENTS (wbuffer)))
|
||||
default_monthname[i] = g_strdup_printf ("(%d)", i);
|
||||
else
|
||||
default_monthname[i] = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GetLocaleInfoA (GetThreadLocale (),
|
||||
(LOCALE_SMONTHNAME1 + i) | LOCALE_USE_CP_ACP,
|
||||
buffer, G_N_ELEMENTS (buffer)))
|
||||
default_monthname[i] = g_strdup_printf ("(%d)", i);
|
||||
else
|
||||
default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Set defaults */
|
||||
@@ -595,8 +653,6 @@ gtk_calendar_init (GtkCalendar *calendar)
|
||||
calendar->month = tm->tm_mon;
|
||||
calendar->year = 1900 + tm->tm_year;
|
||||
|
||||
calendar_compute_days (calendar);
|
||||
|
||||
for (i=0;i<31;i++)
|
||||
calendar->marked_date[i] = FALSE;
|
||||
calendar->num_marked_dates = 0;
|
||||
@@ -651,8 +707,18 @@ gtk_calendar_init (GtkCalendar *calendar)
|
||||
g_warning ("Whoever translated calendar:MY did so wrongly.\n");
|
||||
|
||||
#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
|
||||
week_start = nl_langinfo (_NL_TIME_FIRST_WEEKDAY);
|
||||
priv->week_start = *((unsigned char *) week_start) % 7 - 1;
|
||||
langinfo = nl_langinfo (_NL_TIME_FIRST_WEEKDAY);
|
||||
first_weekday = langinfo[0];
|
||||
langinfo = nl_langinfo (_NL_TIME_WEEK_1STDAY);
|
||||
week_origin = GPOINTER_TO_INT (langinfo);
|
||||
if (week_origin == 19971130) /* Sunday */
|
||||
week_1stday = 0;
|
||||
else if (week_origin == 19971201) /* Monday */
|
||||
week_1stday = 1;
|
||||
else
|
||||
g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
|
||||
|
||||
priv->week_start = (week_1stday + first_weekday - 1) % 7;
|
||||
#else
|
||||
/* Translate to calendar:week_start:0 if you want Sunday to be the
|
||||
* first day of the week to calendar:week_start:1 if you want Monday
|
||||
@@ -671,6 +737,8 @@ gtk_calendar_init (GtkCalendar *calendar)
|
||||
priv->week_start = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
calendar_compute_days (calendar);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+64
-31
@@ -238,6 +238,10 @@ gtk_cell_renderer_pixbuf_finalize (GObject *object)
|
||||
|
||||
if (cellpixbuf->pixbuf)
|
||||
g_object_unref (cellpixbuf->pixbuf);
|
||||
if (cellpixbuf->pixbuf_expander_open)
|
||||
g_object_unref (cellpixbuf->pixbuf_expander_open);
|
||||
if (cellpixbuf->pixbuf_expander_closed)
|
||||
g_object_unref (cellpixbuf->pixbuf_expander_closed);
|
||||
|
||||
g_free (priv->stock_id);
|
||||
g_free (priv->stock_detail);
|
||||
@@ -260,16 +264,13 @@ gtk_cell_renderer_pixbuf_get_property (GObject *object,
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_PIXBUF:
|
||||
g_value_set_object (value,
|
||||
cellpixbuf->pixbuf ? G_OBJECT (cellpixbuf->pixbuf) : NULL);
|
||||
g_value_set_object (value, G_OBJECT (cellpixbuf->pixbuf));
|
||||
break;
|
||||
case PROP_PIXBUF_EXPANDER_OPEN:
|
||||
g_value_set_object (value,
|
||||
cellpixbuf->pixbuf_expander_open ? G_OBJECT (cellpixbuf->pixbuf_expander_open) : NULL);
|
||||
g_value_set_object (value, G_OBJECT (cellpixbuf->pixbuf_expander_open));
|
||||
break;
|
||||
case PROP_PIXBUF_EXPANDER_CLOSED:
|
||||
g_value_set_object (value,
|
||||
cellpixbuf->pixbuf_expander_closed ? G_OBJECT (cellpixbuf->pixbuf_expander_closed) : NULL);
|
||||
g_value_set_object (value, G_OBJECT (cellpixbuf->pixbuf_expander_closed));
|
||||
break;
|
||||
case PROP_STOCK_ID:
|
||||
g_value_set_string (value, priv->stock_id);
|
||||
@@ -299,7 +300,6 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
GtkCellRendererPixbuf *cellpixbuf = GTK_CELL_RENDERER_PIXBUF (object);
|
||||
GtkCellRendererPixbufPrivate *priv;
|
||||
|
||||
@@ -308,28 +308,34 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
|
||||
switch (param_id)
|
||||
{
|
||||
case PROP_PIXBUF:
|
||||
pixbuf = (GdkPixbuf*) g_value_get_object (value);
|
||||
if (pixbuf)
|
||||
g_object_ref (pixbuf);
|
||||
if (cellpixbuf->pixbuf)
|
||||
g_object_unref (cellpixbuf->pixbuf);
|
||||
cellpixbuf->pixbuf = pixbuf;
|
||||
cellpixbuf->pixbuf = (GdkPixbuf*) g_value_dup_object (value);
|
||||
if (cellpixbuf->pixbuf)
|
||||
{
|
||||
if (priv->stock_id)
|
||||
{
|
||||
g_free (priv->stock_id);
|
||||
priv->stock_id = NULL;
|
||||
g_object_notify (object, "stock-id");
|
||||
}
|
||||
if (priv->icon_name)
|
||||
{
|
||||
g_free (priv->icon_name);
|
||||
priv->icon_name = NULL;
|
||||
g_object_notify (object, "icon-name");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PROP_PIXBUF_EXPANDER_OPEN:
|
||||
pixbuf = (GdkPixbuf*) g_value_get_object (value);
|
||||
if (pixbuf)
|
||||
g_object_ref (pixbuf);
|
||||
if (cellpixbuf->pixbuf_expander_open)
|
||||
g_object_unref (cellpixbuf->pixbuf_expander_open);
|
||||
cellpixbuf->pixbuf_expander_open = pixbuf;
|
||||
cellpixbuf->pixbuf_expander_open = (GdkPixbuf*) g_value_dup_object (value);
|
||||
break;
|
||||
case PROP_PIXBUF_EXPANDER_CLOSED:
|
||||
pixbuf = (GdkPixbuf*) g_value_get_object (value);
|
||||
if (pixbuf)
|
||||
g_object_ref (pixbuf);
|
||||
if (cellpixbuf->pixbuf_expander_closed)
|
||||
g_object_unref (cellpixbuf->pixbuf_expander_closed);
|
||||
cellpixbuf->pixbuf_expander_closed = pixbuf;
|
||||
cellpixbuf->pixbuf_expander_closed = (GdkPixbuf*) g_value_dup_object (value);
|
||||
break;
|
||||
case PROP_STOCK_ID:
|
||||
if (priv->stock_id)
|
||||
@@ -338,12 +344,26 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
|
||||
{
|
||||
g_object_unref (cellpixbuf->pixbuf);
|
||||
cellpixbuf->pixbuf = NULL;
|
||||
g_object_notify (object, "pixbuf");
|
||||
}
|
||||
g_free (priv->stock_id);
|
||||
g_free (priv->icon_name);
|
||||
priv->icon_name = NULL;
|
||||
}
|
||||
priv->stock_id = g_strdup (g_value_get_string (value));
|
||||
priv->stock_id = g_value_dup_string (value);
|
||||
if (priv->stock_id)
|
||||
{
|
||||
if (cellpixbuf->pixbuf)
|
||||
{
|
||||
g_object_unref (cellpixbuf->pixbuf);
|
||||
cellpixbuf->pixbuf = NULL;
|
||||
g_object_notify (object, "pixbuf");
|
||||
}
|
||||
if (priv->icon_name)
|
||||
{
|
||||
g_free (priv->icon_name);
|
||||
priv->icon_name = NULL;
|
||||
g_object_notify (object, "icon-name");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PROP_STOCK_SIZE:
|
||||
priv->stock_size = g_value_get_uint (value);
|
||||
@@ -351,7 +371,7 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
|
||||
case PROP_STOCK_DETAIL:
|
||||
if (priv->stock_detail)
|
||||
g_free (priv->stock_detail);
|
||||
priv->stock_detail = g_strdup (g_value_get_string (value));
|
||||
priv->stock_detail = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_ICON_NAME:
|
||||
if (priv->icon_name)
|
||||
@@ -360,11 +380,26 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
|
||||
{
|
||||
g_object_unref (cellpixbuf->pixbuf);
|
||||
cellpixbuf->pixbuf = NULL;
|
||||
g_object_notify (object, "pixbuf");
|
||||
}
|
||||
g_free (priv->stock_id);
|
||||
g_free (priv->icon_name);
|
||||
}
|
||||
priv->icon_name = g_strdup (g_value_get_string (value));
|
||||
priv->icon_name = g_value_dup_string (value);
|
||||
if (priv->icon_name)
|
||||
{
|
||||
if (cellpixbuf->pixbuf)
|
||||
{
|
||||
g_object_unref (cellpixbuf->pixbuf);
|
||||
cellpixbuf->pixbuf = NULL;
|
||||
g_object_notify (object, "pixbuf");
|
||||
}
|
||||
if (priv->stock_id)
|
||||
{
|
||||
g_free (priv->stock_id);
|
||||
priv->stock_id = NULL;
|
||||
g_object_notify (object, "stock-id");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PROP_FOLLOW_STATE:
|
||||
priv->follow_state = g_value_get_boolean (value);
|
||||
@@ -373,12 +408,6 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
||||
break;
|
||||
}
|
||||
|
||||
if (cellpixbuf->pixbuf && priv->stock_id)
|
||||
{
|
||||
g_object_unref (cellpixbuf->pixbuf);
|
||||
cellpixbuf->pixbuf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -415,6 +444,8 @@ gtk_cell_renderer_pixbuf_create_stock_pixbuf (GtkCellRendererPixbuf *cellpixbuf,
|
||||
priv->stock_id,
|
||||
priv->stock_size,
|
||||
priv->stock_detail);
|
||||
|
||||
g_object_notify (G_OBJECT (cellpixbuf), "pixbuf");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -454,6 +485,8 @@ gtk_cell_renderer_pixbuf_create_named_icon_pixbuf (GtkCellRendererPixbuf *cellpi
|
||||
g_warning ("could not load image: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (cellpixbuf), "pixbuf");
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
|
||||
@@ -1822,9 +1822,9 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
|
||||
"editing_done",
|
||||
G_CALLBACK (gtk_cell_renderer_text_editing_done),
|
||||
celltext);
|
||||
priv->focus_out_id = g_signal_connect (priv->entry, "focus_out_event",
|
||||
G_CALLBACK (gtk_cell_renderer_text_focus_out_event),
|
||||
celltext);
|
||||
priv->focus_out_id = g_signal_connect_after (priv->entry, "focus_out_event",
|
||||
G_CALLBACK (gtk_cell_renderer_text_focus_out_event),
|
||||
celltext);
|
||||
priv->populate_popup_id =
|
||||
g_signal_connect (priv->entry, "populate_popup",
|
||||
G_CALLBACK (gtk_cell_renderer_text_populate_popup),
|
||||
|
||||
+2
-1
@@ -1032,7 +1032,8 @@ request_image_received_func (GtkClipboard *clipboard,
|
||||
|
||||
info->callback (clipboard, result, info->user_data);
|
||||
g_free (info);
|
||||
g_object_unref (result);
|
||||
if (result)
|
||||
g_object_unref (result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -567,6 +567,8 @@ gtk_color_button_init (GtkColorButton *color_button)
|
||||
|
||||
layout = gtk_widget_create_pango_layout (GTK_WIDGET (color_button), "Black");
|
||||
pango_layout_get_pixel_extents (layout, NULL, &rect);
|
||||
g_object_unref (layout);
|
||||
|
||||
gtk_widget_set_size_request (color_button->priv->draw_area, rect.width - 2, rect.height - 2);
|
||||
g_signal_connect (color_button->priv->draw_area, "expose-event",
|
||||
G_CALLBACK (expose_event), color_button);
|
||||
|
||||
+5
-1
@@ -3495,6 +3495,9 @@ gtk_combo_box_key_press (GtkWidget *widget,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (state != 0)
|
||||
return FALSE;
|
||||
|
||||
switch (event->keyval)
|
||||
{
|
||||
case GDK_Down:
|
||||
@@ -4457,7 +4460,8 @@ gtk_combo_box_set_active_internal (GtkComboBox *combo_box,
|
||||
path);
|
||||
}
|
||||
|
||||
g_signal_emit_by_name (combo_box, "changed", NULL, NULL);
|
||||
g_signal_emit (combo_box, combo_box_signals[CHANGED], 0);
|
||||
g_object_notify (G_OBJECT (combo_box), "active");
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -609,7 +609,7 @@ gtk_drag_get_cursor (GdkDisplay *display,
|
||||
if (!cursor_pixbuf)
|
||||
{
|
||||
cursor_pixbuf = g_object_ref (drag_cursors[i].pixbuf);
|
||||
icon_anchor = GTK_ANCHOR_NORTH;
|
||||
icon_anchor = GTK_ANCHOR_NORTH_WEST;
|
||||
icon_x = icon_y = -2;
|
||||
}
|
||||
else
|
||||
@@ -3011,7 +3011,7 @@ gtk_drag_set_icon_pixmap (GdkDragContext *context,
|
||||
* @hot_x: the X offset of the hotspot within the icon
|
||||
* @hot_y: the Y offset of the hotspot within the icon
|
||||
*
|
||||
* Sets the icon for the window from a named themed icon. See
|
||||
* Sets the icon for a given drag from a named themed icon. See
|
||||
* the docs for #GtkIconTheme for more details. Note that the
|
||||
* size of the icon depends on the icon theme (the icon is
|
||||
* loaded at the symbolic size #GTK_ICON_SIZE_DND), thus
|
||||
|
||||
+57
-13
@@ -37,6 +37,7 @@
|
||||
#include "gtkdnd.h"
|
||||
#include "gtkentry.h"
|
||||
#include "gtkimagemenuitem.h"
|
||||
#include "gtkimcontextsimple.h"
|
||||
#include "gtkimmulticontext.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmain.h"
|
||||
@@ -1049,6 +1050,18 @@ gtk_entry_destroy (GtkObject *object)
|
||||
gtk_entry_reset_im_context (entry);
|
||||
gtk_entry_reset_layout (entry);
|
||||
|
||||
if (entry->blink_timeout)
|
||||
{
|
||||
g_source_remove (entry->blink_timeout);
|
||||
entry->blink_timeout = 0;
|
||||
}
|
||||
|
||||
if (entry->recompute_idle)
|
||||
{
|
||||
g_source_remove (entry->recompute_idle);
|
||||
entry->recompute_idle = 0;
|
||||
}
|
||||
|
||||
if (!entry->visible)
|
||||
{
|
||||
/* We want to trash the text here because the entry might be leaked. */
|
||||
@@ -3938,9 +3951,37 @@ gtk_entry_set_visibility (GtkEntry *entry,
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ENTRY (entry));
|
||||
|
||||
entry->visible = visible ? TRUE : FALSE;
|
||||
g_object_notify (G_OBJECT (entry), "visibility");
|
||||
gtk_entry_recompute (entry);
|
||||
visible = visible != FALSE;
|
||||
|
||||
if (entry->visible != visible)
|
||||
{
|
||||
if (GTK_WIDGET_HAS_FOCUS (entry) && !visible)
|
||||
gtk_im_context_focus_out (entry->im_context);
|
||||
|
||||
g_object_unref (entry->im_context);
|
||||
|
||||
if (visible)
|
||||
entry->im_context = gtk_im_multicontext_new ();
|
||||
else
|
||||
entry->im_context = gtk_im_context_simple_new ();
|
||||
|
||||
g_signal_connect (entry->im_context, "commit",
|
||||
G_CALLBACK (gtk_entry_commit_cb), entry);
|
||||
g_signal_connect (entry->im_context, "preedit_changed",
|
||||
G_CALLBACK (gtk_entry_preedit_changed_cb), entry);
|
||||
g_signal_connect (entry->im_context, "retrieve_surrounding",
|
||||
G_CALLBACK (gtk_entry_retrieve_surrounding_cb), entry);
|
||||
g_signal_connect (entry->im_context, "delete_surrounding",
|
||||
G_CALLBACK (gtk_entry_delete_surrounding_cb), entry);
|
||||
|
||||
if (GTK_WIDGET_HAS_FOCUS (entry) && visible)
|
||||
gtk_im_context_focus_in (entry->im_context);
|
||||
|
||||
entry->visible = visible;
|
||||
|
||||
g_object_notify (G_OBJECT (entry), "visibility");
|
||||
gtk_entry_recompute (entry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4566,18 +4607,21 @@ popup_targets_received (GtkClipboard *clipboard,
|
||||
menuitem = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (menuitem);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (entry->popup_menu), menuitem);
|
||||
|
||||
if (entry->visible)
|
||||
{
|
||||
menuitem = gtk_menu_item_new_with_mnemonic (_("Input _Methods"));
|
||||
gtk_widget_set_sensitive (menuitem, entry->editable);
|
||||
gtk_widget_show (menuitem);
|
||||
submenu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
|
||||
|
||||
menuitem = gtk_menu_item_new_with_mnemonic (_("Input _Methods"));
|
||||
gtk_widget_set_sensitive (menuitem, entry->editable);
|
||||
gtk_widget_show (menuitem);
|
||||
submenu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
|
||||
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (entry->popup_menu), menuitem);
|
||||
|
||||
gtk_im_multicontext_append_menuitems (GTK_IM_MULTICONTEXT (entry->im_context),
|
||||
GTK_MENU_SHELL (submenu));
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (entry->popup_menu), menuitem);
|
||||
|
||||
gtk_im_multicontext_append_menuitems (GTK_IM_MULTICONTEXT (entry->im_context),
|
||||
GTK_MENU_SHELL (submenu));
|
||||
}
|
||||
|
||||
menuitem = gtk_menu_item_new_with_mnemonic (_("_Insert Unicode Control Character"));
|
||||
gtk_widget_show (menuitem);
|
||||
|
||||
|
||||
@@ -1387,7 +1387,8 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
|
||||
else if (x + popup_req.width > monitor.x + monitor.width)
|
||||
x = monitor.x + monitor.width - popup_req.width;
|
||||
|
||||
if (y + entry_req.height + popup_req.height <= monitor.y + monitor.height)
|
||||
if (y + entry_req.height + popup_req.height <= monitor.y + monitor.height ||
|
||||
y - monitor.y < (monitor.y + monitor.height) - (y + entry_req.height))
|
||||
{
|
||||
y += entry_req.height;
|
||||
above = FALSE;
|
||||
@@ -1416,6 +1417,7 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
|
||||
{
|
||||
GtkTreeViewColumn *column;
|
||||
GList *renderers;
|
||||
GtkWidget *toplevel;
|
||||
|
||||
if (GTK_WIDGET_MAPPED (completion->priv->popup_window))
|
||||
return;
|
||||
@@ -1423,6 +1425,9 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
|
||||
if (!GTK_WIDGET_MAPPED (completion->priv->entry))
|
||||
return;
|
||||
|
||||
if (!GTK_WIDGET_HAS_FOCUS (completion->priv->entry))
|
||||
return;
|
||||
|
||||
completion->priv->ignore_enter = TRUE;
|
||||
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (completion->priv->action_view), 0);
|
||||
@@ -1437,6 +1442,11 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
|
||||
|
||||
_gtk_entry_completion_resize_popup (completion);
|
||||
|
||||
toplevel = gtk_widget_get_toplevel (completion->priv->entry);
|
||||
if (GTK_IS_WINDOW (toplevel))
|
||||
gtk_window_group_add_window (_gtk_window_get_group (GTK_WINDOW (toplevel)),
|
||||
GTK_WINDOW (completion->priv->popup_window));
|
||||
|
||||
gtk_widget_show (completion->priv->popup_window);
|
||||
|
||||
gtk_grab_add (completion->priv->popup_window);
|
||||
@@ -1552,7 +1562,7 @@ gtk_entry_completion_real_insert_prefix (GtkEntryCompletion *completion,
|
||||
gint pos = prefix_len;
|
||||
|
||||
gtk_editable_insert_text (GTK_EDITABLE (completion->priv->entry),
|
||||
prefix + key_len, -1, &pos);
|
||||
prefix + strlen (key), -1, &pos);
|
||||
gtk_editable_select_region (GTK_EDITABLE (completion->priv->entry),
|
||||
key_len, prefix_len);
|
||||
|
||||
|
||||
+19
-6
@@ -260,7 +260,16 @@ gtk_file_chooser_class_init (gpointer g_iface)
|
||||
P_("Whether the hidden files and folders should be displayed"),
|
||||
FALSE,
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
|
||||
/**
|
||||
* GtkFileChooser:do-overwrite-confirmation:
|
||||
*
|
||||
* Whether a file chooser in GTK_FILE_CHOOSER_ACTION_SAVE
|
||||
* will present an overwrite confirmation dialog if the user
|
||||
* selects a file name that already exists.
|
||||
*
|
||||
* Since: 2.8
|
||||
*/
|
||||
g_object_interface_install_property (g_iface,
|
||||
g_param_spec_boolean ("do-overwrite-confirmation",
|
||||
P_("Do overwrite confirmation"),
|
||||
@@ -691,9 +700,11 @@ gtk_file_chooser_set_current_folder (GtkFileChooser *chooser,
|
||||
* Gets the current folder of @chooser as a local filename.
|
||||
* See gtk_file_chooser_set_current_folder().
|
||||
*
|
||||
* Return value: the full path of the current folder, or %NULL
|
||||
* if the current path cannot be represented as a local filename.
|
||||
* Free with g_free().
|
||||
* Return value: the full path of the current folder, or %NULL if the current
|
||||
* path cannot be represented as a local filename. Free with g_free(). This
|
||||
* function will also return %NULL if the file chooser was unable to load the
|
||||
* last folder that was requested from it; for example, as would be for calling
|
||||
* gtk_file_chooser_set_current_folder() on a nonexistent folder.
|
||||
*
|
||||
* Since: 2.4
|
||||
**/
|
||||
@@ -1010,8 +1021,10 @@ gtk_file_chooser_set_current_folder_uri (GtkFileChooser *chooser,
|
||||
* Gets the current folder of @chooser as an URI.
|
||||
* See gtk_file_chooser_set_current_folder_uri().
|
||||
*
|
||||
* Return value: the URI for the current folder.
|
||||
* Free with g_free().
|
||||
* Return value: the URI for the current folder. Free with g_free(). This
|
||||
* function will also return %NULL if the file chooser was unable to load the
|
||||
* last folder that was requested from it; for example, as would be for calling
|
||||
* gtk_file_chooser_set_current_folder_uri() on a nonexistent folder.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
|
||||
@@ -155,6 +155,9 @@ struct _GtkFileChooserButtonPrivate
|
||||
|
||||
/* Used for hiding/showing the dialog when the button is hidden */
|
||||
guint8 active : 1;
|
||||
|
||||
/* Used to track whether we need to set a default current folder on ::map() */
|
||||
guint8 folder_has_been_set : 1;
|
||||
};
|
||||
|
||||
|
||||
@@ -211,6 +214,7 @@ static void gtk_file_chooser_button_show_all (GtkWidget *wi
|
||||
static void gtk_file_chooser_button_hide_all (GtkWidget *widget);
|
||||
static void gtk_file_chooser_button_show (GtkWidget *widget);
|
||||
static void gtk_file_chooser_button_hide (GtkWidget *widget);
|
||||
static void gtk_file_chooser_button_map (GtkWidget *widget);
|
||||
static gboolean gtk_file_chooser_button_mnemonic_activate (GtkWidget *widget,
|
||||
gboolean group_cycling);
|
||||
static void gtk_file_chooser_button_style_set (GtkWidget *widget,
|
||||
@@ -322,6 +326,7 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
|
||||
widget_class->hide_all = gtk_file_chooser_button_hide_all;
|
||||
widget_class->show = gtk_file_chooser_button_show;
|
||||
widget_class->hide = gtk_file_chooser_button_hide;
|
||||
widget_class->map = gtk_file_chooser_button_map;
|
||||
widget_class->style_set = gtk_file_chooser_button_style_set;
|
||||
widget_class->screen_changed = gtk_file_chooser_button_screen_changed;
|
||||
widget_class->mnemonic_activate = gtk_file_chooser_button_mnemonic_activate;
|
||||
@@ -593,6 +598,7 @@ gtk_file_chooser_button_constructor (GType type,
|
||||
GObject *object;
|
||||
GtkFileChooserButtonPrivate *priv;
|
||||
GSList *list;
|
||||
char *current_folder;
|
||||
|
||||
object = (*G_OBJECT_CLASS (gtk_file_chooser_button_parent_class)->constructor) (type,
|
||||
n_params,
|
||||
@@ -627,6 +633,13 @@ gtk_file_chooser_button_constructor (GType type,
|
||||
-1);
|
||||
}
|
||||
|
||||
current_folder = gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (priv->dialog));
|
||||
if (current_folder != NULL)
|
||||
{
|
||||
priv->folder_has_been_set = TRUE;
|
||||
g_free (current_folder);
|
||||
}
|
||||
|
||||
g_free (priv->backend);
|
||||
priv->backend = NULL;
|
||||
|
||||
@@ -1013,6 +1026,28 @@ gtk_file_chooser_button_hide (GtkWidget *widget)
|
||||
(*GTK_WIDGET_CLASS (gtk_file_chooser_button_parent_class)->hide) (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_file_chooser_button_map (GtkWidget *widget)
|
||||
{
|
||||
GtkFileChooserButtonPrivate *priv;
|
||||
|
||||
priv = GTK_FILE_CHOOSER_BUTTON_GET_PRIVATE (widget);
|
||||
|
||||
if (!priv->folder_has_been_set)
|
||||
{
|
||||
char *current_working_dir;
|
||||
|
||||
current_working_dir = g_get_current_dir ();
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget), current_working_dir);
|
||||
g_free (current_working_dir);
|
||||
|
||||
priv->folder_has_been_set = TRUE;
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_CLASS (gtk_file_chooser_button_parent_class)->map)
|
||||
(*GTK_WIDGET_CLASS (gtk_file_chooser_button_parent_class)->map) (widget);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_file_chooser_button_mnemonic_activate (GtkWidget *widget,
|
||||
gboolean group_cycling)
|
||||
@@ -1959,10 +1994,21 @@ open_dialog (GtkFileChooserButton *button)
|
||||
|
||||
if (GTK_WIDGET_TOPLEVEL (toplevel) && GTK_IS_WINDOW (toplevel))
|
||||
{
|
||||
if (GTK_WINDOW (toplevel) != gtk_window_get_transient_for (GTK_WINDOW (priv->dialog)))
|
||||
gtk_window_set_transient_for (GTK_WINDOW (priv->dialog),
|
||||
GTK_WINDOW (toplevel));
|
||||
GtkWindow *transient_parent = gtk_window_get_transient_for (GTK_WINDOW (priv->dialog));
|
||||
|
||||
if (GTK_WINDOW (toplevel) != transient_parent)
|
||||
{
|
||||
if (transient_parent && transient_parent->group)
|
||||
gtk_window_group_remove_window (transient_parent->group,
|
||||
GTK_WINDOW (priv->dialog));
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (priv->dialog),
|
||||
GTK_WINDOW (toplevel));
|
||||
if (GTK_WINDOW (toplevel)->group)
|
||||
gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
|
||||
GTK_WINDOW (priv->dialog));
|
||||
}
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (priv->dialog),
|
||||
gtk_window_get_modal (GTK_WINDOW (toplevel)));
|
||||
}
|
||||
@@ -2064,7 +2110,15 @@ static void
|
||||
dialog_current_folder_changed_cb (GtkFileChooser *dialog,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_signal_emit_by_name (user_data, "current-folder-changed");
|
||||
GtkFileChooserButton *button;
|
||||
GtkFileChooserButtonPrivate *priv;
|
||||
|
||||
button = GTK_FILE_CHOOSER_BUTTON (user_data);
|
||||
priv = GTK_FILE_CHOOSER_BUTTON_GET_PRIVATE (button);
|
||||
|
||||
priv->folder_has_been_set = TRUE;
|
||||
|
||||
g_signal_emit_by_name (button, "current-folder-changed");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2267,7 +2321,7 @@ gtk_file_chooser_button_new_with_backend (const gchar *title,
|
||||
*
|
||||
* Creates a #GtkFileChooserButton widget which uses @dialog as it's
|
||||
* file-picking window. Note that @dialog must be a #GtkFileChooserDialog (or
|
||||
* subclass).
|
||||
* subclass) and must not have %GTK_DIALOG_DESTROY_WITH_PARENT set.
|
||||
*
|
||||
* Returns: a new button widget.
|
||||
*
|
||||
|
||||
+164
-34
@@ -83,7 +83,7 @@
|
||||
|
||||
/* Profiling stuff */
|
||||
|
||||
#define PROFILE_FILE_CHOOSER
|
||||
#undef PROFILE_FILE_CHOOSER
|
||||
#ifdef PROFILE_FILE_CHOOSER
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
@@ -152,6 +152,12 @@ typedef enum {
|
||||
LOAD_FINISHED /* Model is fully loaded and inserted into the tree */
|
||||
} LoadState;
|
||||
|
||||
typedef enum {
|
||||
RELOAD_EMPTY, /* No folder has been set */
|
||||
RELOAD_HAS_FOLDER, /* We have a folder, although it may not be completely loaded yet; no need to reload */
|
||||
RELOAD_WAS_UNMAPPED /* We had a folder but got unmapped; reload is needed */
|
||||
} ReloadState;
|
||||
|
||||
#define MAX_LOADING_TIME 500
|
||||
|
||||
struct _GtkFileChooserDefaultClass
|
||||
@@ -206,6 +212,7 @@ struct _GtkFileChooserDefault
|
||||
GtkTreeModelSort *sort_model;
|
||||
|
||||
LoadState load_state;
|
||||
ReloadState reload_state;
|
||||
guint load_timeout_id;
|
||||
|
||||
GSList *pending_select_paths;
|
||||
@@ -373,6 +380,7 @@ static void gtk_file_chooser_default_get_property (GObject *ob
|
||||
static void gtk_file_chooser_default_dispose (GObject *object);
|
||||
static void gtk_file_chooser_default_show_all (GtkWidget *widget);
|
||||
static void gtk_file_chooser_default_map (GtkWidget *widget);
|
||||
static void gtk_file_chooser_default_unmap (GtkWidget *widget);
|
||||
static void gtk_file_chooser_default_hierarchy_changed (GtkWidget *widget,
|
||||
GtkWidget *previous_toplevel);
|
||||
static void gtk_file_chooser_default_style_set (GtkWidget *widget,
|
||||
@@ -480,6 +488,7 @@ static void select_func (GtkFileSystemModel *model,
|
||||
|
||||
static void path_bar_clicked (GtkPathBar *path_bar,
|
||||
GtkFilePath *file_path,
|
||||
GtkFilePath *child_path,
|
||||
gboolean child_is_hidden,
|
||||
GtkFileChooserDefault *impl);
|
||||
|
||||
@@ -615,6 +624,7 @@ gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class)
|
||||
|
||||
widget_class->show_all = gtk_file_chooser_default_show_all;
|
||||
widget_class->map = gtk_file_chooser_default_map;
|
||||
widget_class->unmap = gtk_file_chooser_default_unmap;
|
||||
widget_class->hierarchy_changed = gtk_file_chooser_default_hierarchy_changed;
|
||||
widget_class->style_set = gtk_file_chooser_default_style_set;
|
||||
widget_class->screen_changed = gtk_file_chooser_default_screen_changed;
|
||||
@@ -745,6 +755,7 @@ gtk_file_chooser_default_init (GtkFileChooserDefault *impl)
|
||||
impl->show_hidden = FALSE;
|
||||
impl->icon_size = FALLBACK_ICON_SIZE;
|
||||
impl->load_state = LOAD_EMPTY;
|
||||
impl->reload_state = RELOAD_EMPTY;
|
||||
impl->pending_select_paths = NULL;
|
||||
|
||||
gtk_box_set_spacing (GTK_BOX (impl), 12);
|
||||
@@ -1420,7 +1431,7 @@ shortcuts_append_home (GtkFileChooserDefault *impl)
|
||||
home_path = gtk_file_system_filename_to_path (impl->file_system, home);
|
||||
|
||||
error = NULL;
|
||||
impl->has_home = shortcuts_insert_path (impl, -1, FALSE, NULL, home_path, _("Home"), FALSE, &error);
|
||||
impl->has_home = shortcuts_insert_path (impl, -1, FALSE, NULL, home_path, NULL, FALSE, &error);
|
||||
if (!impl->has_home)
|
||||
error_getting_info_dialog (impl, home_path, error);
|
||||
|
||||
@@ -1616,14 +1627,22 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
|
||||
|
||||
if (impl->local_only)
|
||||
{
|
||||
GtkFilePath *base_path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
|
||||
gboolean is_local = gtk_file_system_path_is_local (impl->file_system, base_path);
|
||||
gtk_file_path_free (base_path);
|
||||
|
||||
if (!is_local)
|
||||
if (gtk_file_system_volume_get_is_mounted (impl->file_system, volume))
|
||||
{
|
||||
gtk_file_system_volume_free (impl->file_system, volume);
|
||||
continue;
|
||||
GtkFilePath *base_path;
|
||||
|
||||
base_path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
|
||||
if (base_path != NULL)
|
||||
{
|
||||
gboolean is_local = gtk_file_system_path_is_local (impl->file_system, base_path);
|
||||
gtk_file_path_free (base_path);
|
||||
|
||||
if (!is_local)
|
||||
{
|
||||
gtk_file_system_volume_free (impl->file_system, volume);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1798,7 +1817,7 @@ shortcuts_add_current_folder (GtkFileChooserDefault *impl)
|
||||
impl->shortcuts_current_folder_active = success;
|
||||
}
|
||||
|
||||
if (success)
|
||||
if (success && impl->save_folder_combo != NULL)
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (impl->save_folder_combo), pos);
|
||||
}
|
||||
|
||||
@@ -1859,7 +1878,6 @@ shortcuts_model_create (GtkFileChooserDefault *impl)
|
||||
shortcuts_append_home (impl);
|
||||
shortcuts_append_desktop (impl);
|
||||
shortcuts_add_volumes (impl);
|
||||
shortcuts_add_bookmarks (impl);
|
||||
}
|
||||
|
||||
impl->shortcuts_filter_model = shortcuts_model_filter_new (impl,
|
||||
@@ -2888,6 +2906,7 @@ shortcuts_reorder (GtkFileChooserDefault *impl,
|
||||
const GtkFilePath *file_path;
|
||||
GtkFilePath *file_path_copy;
|
||||
GError *error;
|
||||
gchar *name;
|
||||
|
||||
/* Get the selected path */
|
||||
|
||||
@@ -2903,12 +2922,13 @@ shortcuts_reorder (GtkFileChooserDefault *impl,
|
||||
g_assert (old_position >= 0 && old_position < impl->num_bookmarks);
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter,
|
||||
SHORTCUTS_COL_NAME, &name,
|
||||
SHORTCUTS_COL_DATA, &col_data,
|
||||
SHORTCUTS_COL_IS_VOLUME, &is_volume,
|
||||
-1);
|
||||
g_assert (col_data != NULL);
|
||||
g_assert (!is_volume);
|
||||
|
||||
|
||||
file_path = col_data;
|
||||
file_path_copy = gtk_file_path_copy (file_path); /* removal below will free file_path, so we need a copy */
|
||||
|
||||
@@ -2922,7 +2942,10 @@ shortcuts_reorder (GtkFileChooserDefault *impl,
|
||||
|
||||
error = NULL;
|
||||
if (gtk_file_system_remove_bookmark (impl->file_system, file_path_copy, &error))
|
||||
shortcuts_add_bookmark_from_path (impl, file_path_copy, new_position);
|
||||
{
|
||||
shortcuts_add_bookmark_from_path (impl, file_path_copy, new_position);
|
||||
gtk_file_system_set_bookmark_label (impl->file_system, file_path_copy, name);
|
||||
}
|
||||
else
|
||||
error_adding_bookmark_dialog (impl, file_path_copy, error);
|
||||
|
||||
@@ -3041,9 +3064,9 @@ remove_shortcut_cb (GtkMenuItem *item,
|
||||
remove_selected_bookmarks (impl);
|
||||
}
|
||||
|
||||
/* Rename the selected bookmark */
|
||||
static void
|
||||
rename_shortcut_cb (GtkMenuItem *item,
|
||||
GtkFileChooserDefault *impl)
|
||||
rename_selected_bookmark (GtkFileChooserDefault *impl)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GtkTreePath *path;
|
||||
@@ -3065,6 +3088,13 @@ rename_shortcut_cb (GtkMenuItem *item,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
rename_shortcut_cb (GtkMenuItem *item,
|
||||
GtkFileChooserDefault *impl)
|
||||
{
|
||||
rename_selected_bookmark (impl);
|
||||
}
|
||||
|
||||
/* Constructs the popup menu for the file list if needed */
|
||||
static void
|
||||
shortcuts_build_popup_menu (GtkFileChooserDefault *impl)
|
||||
@@ -3905,6 +3935,7 @@ file_pane_create (GtkFileChooserDefault *impl,
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
||||
/* Callback used when the "Browse for more folders" expander is toggled */
|
||||
static void
|
||||
expander_changed_cb (GtkExpander *expander,
|
||||
@@ -3968,7 +3999,7 @@ save_folder_combo_create (GtkFileChooserDefault *impl)
|
||||
}
|
||||
|
||||
/* Creates the widgets specific to Save mode */
|
||||
static GtkWidget *
|
||||
static void
|
||||
save_widgets_create (GtkFileChooserDefault *impl)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
@@ -3976,6 +4007,9 @@ save_widgets_create (GtkFileChooserDefault *impl)
|
||||
GtkWidget *widget;
|
||||
GtkWidget *alignment;
|
||||
|
||||
if (impl->save_widgets != NULL)
|
||||
return;
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 12);
|
||||
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
@@ -4033,7 +4067,25 @@ save_widgets_create (GtkFileChooserDefault *impl)
|
||||
impl);
|
||||
gtk_widget_show_all (alignment);
|
||||
|
||||
return vbox;
|
||||
impl->save_widgets = vbox;
|
||||
gtk_box_pack_start (GTK_BOX (impl), impl->save_widgets, FALSE, FALSE, 0);
|
||||
gtk_box_reorder_child (GTK_BOX (impl), impl->save_widgets, 0);
|
||||
gtk_widget_show (impl->save_widgets);
|
||||
}
|
||||
|
||||
/* Destroys the widgets specific to Save mode */
|
||||
static void
|
||||
save_widgets_destroy (GtkFileChooserDefault *impl)
|
||||
{
|
||||
if (impl->save_widgets == NULL)
|
||||
return;
|
||||
|
||||
gtk_widget_destroy (impl->save_widgets);
|
||||
impl->save_widgets = NULL;
|
||||
impl->save_file_name_entry = NULL;
|
||||
impl->save_folder_label = NULL;
|
||||
impl->save_folder_combo = NULL;
|
||||
impl->save_expander = NULL;
|
||||
}
|
||||
|
||||
/* Creates the main hpaned with the widgets shared by Open and Save mode */
|
||||
@@ -4086,10 +4138,6 @@ gtk_file_chooser_default_constructor (GType type,
|
||||
|
||||
shortcuts_model_create (impl);
|
||||
|
||||
/* Widgets for Save mode */
|
||||
impl->save_widgets = save_widgets_create (impl);
|
||||
gtk_box_pack_start (GTK_BOX (impl), impl->save_widgets, FALSE, FALSE, 0);
|
||||
|
||||
/* The browse widgets */
|
||||
impl->browse_widgets = browse_widgets_create (impl);
|
||||
gtk_box_pack_start (GTK_BOX (impl), impl->browse_widgets, TRUE, TRUE, 0);
|
||||
@@ -4278,7 +4326,7 @@ update_appearance (GtkFileChooserDefault *impl)
|
||||
{
|
||||
const char *text;
|
||||
|
||||
gtk_widget_show (impl->save_widgets);
|
||||
save_widgets_create (impl);
|
||||
|
||||
if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
|
||||
text = _("Save in _folder:");
|
||||
@@ -4287,6 +4335,8 @@ update_appearance (GtkFileChooserDefault *impl)
|
||||
|
||||
gtk_label_set_text_with_mnemonic (GTK_LABEL (impl->save_folder_label), text);
|
||||
|
||||
_gtk_file_chooser_entry_set_action (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry), impl->action);
|
||||
|
||||
if (gtk_expander_get_expanded (GTK_EXPANDER (impl->save_expander)))
|
||||
{
|
||||
gtk_widget_set_sensitive (impl->save_folder_label, FALSE);
|
||||
@@ -4312,7 +4362,7 @@ update_appearance (GtkFileChooserDefault *impl)
|
||||
else if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
|
||||
impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
||||
{
|
||||
gtk_widget_hide (impl->save_widgets);
|
||||
save_widgets_destroy (impl);
|
||||
gtk_widget_show (impl->browse_widgets);
|
||||
}
|
||||
|
||||
@@ -4321,6 +4371,9 @@ update_appearance (GtkFileChooserDefault *impl)
|
||||
else
|
||||
gtk_widget_show (impl->browse_new_folder_button);
|
||||
|
||||
/* This *is* needed; we need to redraw the file list because the "sensitivity"
|
||||
* of files may change depending whether we are in a file or folder-only mode.
|
||||
*/
|
||||
gtk_widget_queue_draw (impl->browse_files_tree_view);
|
||||
|
||||
g_signal_emit_by_name (impl, "default-size-changed");
|
||||
@@ -4356,10 +4409,6 @@ gtk_file_chooser_default_set_property (GObject *object,
|
||||
impl->action = action;
|
||||
update_appearance (impl);
|
||||
}
|
||||
|
||||
if (impl->save_file_name_entry)
|
||||
_gtk_file_chooser_entry_set_action (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry),
|
||||
action);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4724,6 +4773,7 @@ static void
|
||||
gtk_file_chooser_default_map (GtkWidget *widget)
|
||||
{
|
||||
GtkFileChooserDefault *impl;
|
||||
char *current_working_dir;
|
||||
|
||||
profile_start ("start", NULL);
|
||||
|
||||
@@ -4731,10 +4781,29 @@ gtk_file_chooser_default_map (GtkWidget *widget)
|
||||
|
||||
GTK_WIDGET_CLASS (parent_class)->map (widget);
|
||||
|
||||
if (impl->current_folder)
|
||||
switch (impl->reload_state)
|
||||
{
|
||||
case RELOAD_EMPTY:
|
||||
/* The user didn't explicitly give us a folder to display, so we'll use the cwd */
|
||||
current_working_dir = g_get_current_dir ();
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (impl), current_working_dir);
|
||||
g_free (current_working_dir);
|
||||
break;
|
||||
|
||||
case RELOAD_HAS_FOLDER:
|
||||
/* Nothing; we are already loading or loaded, so we don't need to reload */
|
||||
break;
|
||||
|
||||
case RELOAD_WAS_UNMAPPED:
|
||||
/* Just reload the current folder */
|
||||
g_assert (impl->current_folder != NULL);
|
||||
|
||||
pending_select_paths_store_selection (impl);
|
||||
change_folder_and_display_error (impl, impl->current_folder);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
bookmarks_changed_cb (impl->file_system, impl);
|
||||
@@ -4742,6 +4811,19 @@ gtk_file_chooser_default_map (GtkWidget *widget)
|
||||
profile_end ("end", NULL);
|
||||
}
|
||||
|
||||
/* GtkWidget::unmap method */
|
||||
static void
|
||||
gtk_file_chooser_default_unmap (GtkWidget *widget)
|
||||
{
|
||||
GtkFileChooserDefault *impl;
|
||||
|
||||
impl = GTK_FILE_CHOOSER_DEFAULT (widget);
|
||||
|
||||
GTK_WIDGET_CLASS (parent_class)->unmap (widget);
|
||||
|
||||
impl->reload_state = RELOAD_WAS_UNMAPPED;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
list_model_filter_func (GtkFileSystemModel *model,
|
||||
GtkFilePath *path,
|
||||
@@ -5268,7 +5350,14 @@ update_chooser_entry (GtkFileChooserDefault *impl)
|
||||
|
||||
if (!gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
{
|
||||
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry), "");
|
||||
/* If nothing is selected, we only reset the file name entry if we are in
|
||||
* CREATE_FOLDER mode. In SAVE mode, nothing will be selected when the
|
||||
* user starts typeahead in the treeview, and we don't want to clear the
|
||||
* file name entry in that case --- the user could be typing-ahead to look
|
||||
* for a folder name. See http://bugzilla.gnome.org/show_bug.cgi?id=308332
|
||||
*/
|
||||
if (impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
|
||||
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry), "");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5340,6 +5429,8 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser *chooser,
|
||||
gtk_file_path_free (impl->current_folder);
|
||||
|
||||
impl->current_folder = gtk_file_path_copy (path);
|
||||
|
||||
impl->reload_state = RELOAD_HAS_FOLDER;
|
||||
}
|
||||
|
||||
/* Update the widgets that may trigger a folder change themselves. */
|
||||
@@ -5355,8 +5446,9 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser *chooser,
|
||||
|
||||
/* Set the folder on the save entry */
|
||||
|
||||
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry),
|
||||
impl->current_folder);
|
||||
if (impl->save_file_name_entry)
|
||||
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->save_file_name_entry),
|
||||
impl->current_folder);
|
||||
|
||||
/* Create a new list model. This is slightly evil; we store the result value
|
||||
* but perform more actions rather than returning immediately even if it
|
||||
@@ -5384,6 +5476,21 @@ gtk_file_chooser_default_get_current_folder (GtkFileChooser *chooser)
|
||||
{
|
||||
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
|
||||
|
||||
if (impl->reload_state == RELOAD_EMPTY)
|
||||
{
|
||||
char *current_working_dir;
|
||||
GtkFilePath *path;
|
||||
|
||||
/* We are unmapped, or we had an error while loading the last folder. We'll return
|
||||
* the $cwd since once we get (re)mapped, we'll load $cwd anyway unless the caller
|
||||
* explicitly calls set_current_folder() on us.
|
||||
*/
|
||||
current_working_dir = g_get_current_dir ();
|
||||
path = gtk_file_system_filename_to_path (impl->file_system, current_working_dir);
|
||||
g_free (current_working_dir);
|
||||
return path;
|
||||
}
|
||||
|
||||
return gtk_file_path_copy (impl->current_folder);
|
||||
}
|
||||
|
||||
@@ -6335,7 +6442,7 @@ gtk_file_chooser_default_should_respond (GtkFileChooserEmbed *chooser_embed)
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
else if (current_focus == impl->save_file_name_entry)
|
||||
else if ((impl->save_file_name_entry != NULL) && (current_focus == impl->save_file_name_entry))
|
||||
{
|
||||
GtkFilePath *path;
|
||||
gboolean is_well_formed, is_empty, is_file_part_empty;
|
||||
@@ -6645,8 +6752,11 @@ shortcuts_activate_volume (GtkFileChooserDefault *impl,
|
||||
}
|
||||
|
||||
path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
|
||||
change_folder_and_display_error (impl, path);
|
||||
gtk_file_path_free (path);
|
||||
if (path != NULL)
|
||||
{
|
||||
change_folder_and_display_error (impl, path);
|
||||
gtk_file_path_free (path);
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -6726,6 +6836,13 @@ shortcuts_key_press_event_cb (GtkWidget *widget,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((event->keyval == GDK_F2)
|
||||
&& (event->state & modifiers) == 0)
|
||||
{
|
||||
rename_selected_bookmark (impl);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -6832,6 +6949,7 @@ list_row_activated (GtkTreeView *tree_view,
|
||||
static void
|
||||
path_bar_clicked (GtkPathBar *path_bar,
|
||||
GtkFilePath *file_path,
|
||||
GtkFilePath *child_path,
|
||||
gboolean child_is_hidden,
|
||||
GtkFileChooserDefault *impl)
|
||||
{
|
||||
@@ -6844,6 +6962,18 @@ path_bar_clicked (GtkPathBar *path_bar,
|
||||
*/
|
||||
if (child_is_hidden)
|
||||
g_object_set (impl, "show-hidden", TRUE, NULL);
|
||||
|
||||
/* Say we have "/foo/bar/baz" and the user clicks on "bar". We should then
|
||||
* focus the "baz" entry in the files list - the reason for this is that
|
||||
* if user furst changed to /foo/bar/baz from /foo/bar unintentionally instead
|
||||
* of /foo/bar/baz1, it will take quite some time to scroll to baz1 in the file
|
||||
* list, especially if this directory contains lots of folders
|
||||
*/
|
||||
if (child_path != NULL)
|
||||
{
|
||||
gtk_file_chooser_default_select_path (impl, child_path, NULL);
|
||||
browse_files_center_selected_row (impl);
|
||||
}
|
||||
}
|
||||
|
||||
static const GtkFileInfo *
|
||||
|
||||
@@ -144,7 +144,6 @@ gtk_file_chooser_widget_constructor (GType type,
|
||||
{
|
||||
GtkFileChooserWidgetPrivate *priv;
|
||||
GObject *object;
|
||||
gchar *current_folder;
|
||||
|
||||
object = parent_class->constructor (type,
|
||||
n_construct_properties,
|
||||
@@ -158,10 +157,6 @@ gtk_file_chooser_widget_constructor (GType type,
|
||||
gtk_box_pack_start (GTK_BOX (object), priv->impl, TRUE, TRUE, 0);
|
||||
gtk_widget_show (priv->impl);
|
||||
|
||||
current_folder = g_get_current_dir ();
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->impl), current_folder);
|
||||
g_free (current_folder);
|
||||
|
||||
_gtk_file_chooser_set_delegate (GTK_FILE_CHOOSER (object),
|
||||
GTK_FILE_CHOOSER (priv->impl));
|
||||
|
||||
|
||||
+1
-1
@@ -1074,7 +1074,7 @@ gtk_file_system_module_load (GTypeModule *module)
|
||||
{
|
||||
GtkFileSystemModule *fs_module = GTK_FILE_SYSTEM_MODULE (module);
|
||||
|
||||
fs_module->library = g_module_open (fs_module->path, 0);
|
||||
fs_module->library = g_module_open (fs_module->path, G_MODULE_BIND_LAZY);
|
||||
if (!fs_module->library)
|
||||
{
|
||||
g_warning (g_module_error());
|
||||
|
||||
@@ -685,11 +685,15 @@ root_folder_finished_loading_cb (GtkFileFolder *folder,
|
||||
static gboolean
|
||||
idle_finished_loading_cb (GtkFileSystemModel *model)
|
||||
{
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
g_signal_emit (model, file_system_model_signals[FINISHED_LOADING], 0);
|
||||
|
||||
g_source_destroy (model->idle_finished_loading_source);
|
||||
model->idle_finished_loading_source = NULL;
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
+35
-34
@@ -291,9 +291,6 @@ check_volumes (gpointer data)
|
||||
|
||||
g_return_val_if_fail (system_win32, FALSE);
|
||||
|
||||
#if 0
|
||||
printf("check_volumes: system_win32=%p\n", system_win32);
|
||||
#endif
|
||||
if (system_win32->drives != GetLogicalDrives())
|
||||
g_signal_emit_by_name (system_win32, "volumes-changed", 0);
|
||||
|
||||
@@ -303,10 +300,6 @@ check_volumes (gpointer data)
|
||||
static void
|
||||
gtk_file_system_win32_init (GtkFileSystemWin32 *system_win32)
|
||||
{
|
||||
#if 0
|
||||
printf("gtk_file_system_win32_init: %p\n", system_win32);
|
||||
#endif
|
||||
|
||||
/* set up an idle handler for volume changes, every second should be enough */
|
||||
system_win32->timeout = g_timeout_add_full (0, 1000, check_volumes, system_win32, NULL);
|
||||
|
||||
@@ -320,10 +313,6 @@ gtk_file_system_win32_finalize (GObject *object)
|
||||
|
||||
system_win32 = GTK_FILE_SYSTEM_WIN32 (object);
|
||||
|
||||
#if 0
|
||||
printf("gtk_file_system_win32_finalize: %p\n", system_win32);
|
||||
#endif
|
||||
|
||||
g_source_remove (system_win32->timeout);
|
||||
|
||||
/* FIXME: assert that the hash is empty? */
|
||||
@@ -726,7 +715,9 @@ gtk_file_system_win32_get_parent (GtkFileSystem *file_system,
|
||||
*parent = filename_to_path (parent_filename);
|
||||
g_free (parent_filename);
|
||||
}
|
||||
|
||||
#if DEBUGGING_OUTPUT
|
||||
printf ("%s: %s => %s\n", __FUNCTION__, (char*)path, (*parent)?(char*)*parent:"NULL"), fflush(stdout);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -762,8 +753,8 @@ canonicalize_filename (gchar *filename)
|
||||
gchar *past_root;
|
||||
gboolean last_was_slash = FALSE;
|
||||
|
||||
#if 0
|
||||
printf("canonicalize_filename: %s ", filename);
|
||||
#if DEBUGGING_OUTPUT
|
||||
printf("%s: %s ", __FUNCTION__, filename), fflush (stdout);
|
||||
#endif
|
||||
|
||||
past_root = (gchar *) g_path_skip_root (filename);
|
||||
@@ -775,7 +766,7 @@ canonicalize_filename (gchar *filename)
|
||||
if (G_IS_DIR_SEPARATOR (*p))
|
||||
{
|
||||
if (!last_was_slash)
|
||||
*q++ = G_DIR_SEPARATOR;
|
||||
*q++ = '\\';
|
||||
|
||||
last_was_slash = TRUE;
|
||||
}
|
||||
@@ -828,8 +819,9 @@ canonicalize_filename (gchar *filename)
|
||||
q--;
|
||||
|
||||
*q = '\0';
|
||||
#if 0
|
||||
printf(" => %s\n", filename);
|
||||
|
||||
#if DEBUGGING_OUTPUT
|
||||
printf(" => %s\n", filename), fflush (stdout);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -845,15 +837,15 @@ gtk_file_system_win32_parse (GtkFileSystem *file_system,
|
||||
gchar *last_backslash, *last_slash;
|
||||
gboolean result = FALSE;
|
||||
|
||||
#if 0
|
||||
printf("gtk_file_system_win32_parse: base_path=%s str=%s\n",(char*)base_path,str);
|
||||
#if DEBUGGING_OUTPUT
|
||||
printf("%s: base_path=%s str=%s\n",__FUNCTION__,(char*)base_path,str),fflush(stdout);
|
||||
#endif
|
||||
|
||||
base_filename = gtk_file_path_get_string (base_path);
|
||||
g_return_val_if_fail (base_filename != NULL, FALSE);
|
||||
g_return_val_if_fail (g_path_is_absolute (base_filename), FALSE);
|
||||
|
||||
last_backslash = strrchr (str, G_DIR_SEPARATOR);
|
||||
last_backslash = strrchr (str, '\\');
|
||||
last_slash = strrchr (str, '/');
|
||||
if (last_slash == NULL ||
|
||||
(last_backslash != NULL && last_backslash > last_slash))
|
||||
@@ -874,18 +866,25 @@ gtk_file_system_win32_parse (GtkFileSystem *file_system,
|
||||
{
|
||||
if (g_ascii_isalpha (base_filename[0]) &&
|
||||
base_filename[1] == ':')
|
||||
folder_part = g_strdup_printf ("%c:" G_DIR_SEPARATOR_S, base_filename[0]);
|
||||
folder_part = g_strdup_printf ("%c:\\", base_filename[0]);
|
||||
else
|
||||
folder_part = g_strdup (G_DIR_SEPARATOR_S);
|
||||
folder_part = g_strdup ("\\");
|
||||
}
|
||||
else if (g_ascii_isalpha (str[0]) &&
|
||||
str[1] == ':' &&
|
||||
G_IS_DIR_SEPARATOR (str[2]))
|
||||
last_slash == str + 2)
|
||||
folder_part = g_strndup (str, last_slash - str + 1);
|
||||
#if 0
|
||||
/* Hmm, what the heck was this case supposed to do? It splits up
|
||||
* \\server\share\foo\bar into folder_part
|
||||
* \\server\share\foo\bar and file_path bar. Not good. As far as
|
||||
* I can see, this isn't needed.
|
||||
*/
|
||||
else if (G_IS_DIR_SEPARATOR (str[0]) &&
|
||||
G_IS_DIR_SEPARATOR (str[1]) &&
|
||||
(!str[2] || !G_IS_DIR_SEPARATOR (str[2])))
|
||||
folder_part = g_strdup (str);
|
||||
#endif
|
||||
else
|
||||
folder_part = g_strndup (str, last_slash - str);
|
||||
|
||||
@@ -909,8 +908,8 @@ gtk_file_system_win32_parse (GtkFileSystem *file_system,
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
printf("gtk_file_system_win32_parse:returning folder=%s file_part=%s\n",(*folder?(char*)*folder:"NULL"),*file_part);
|
||||
#if DEBUGGING_OUTPUT
|
||||
printf ("%s:returning folder=%s file_part=%s\n", __FUNCTION__, (*folder?(char*)*folder:"NULL"), *file_part), fflush(stdout);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
@@ -936,6 +935,11 @@ gtk_file_system_win32_uri_to_path (GtkFileSystem *file_system,
|
||||
{
|
||||
GtkFilePath *path = NULL;
|
||||
gchar *filename = g_filename_from_uri (uri, NULL, NULL);
|
||||
|
||||
#if DEBUGGING_OUTPUT
|
||||
printf ("%s: %s -> %s\n", __FUNCTION__, uri, filename?filename:"NULL"), fflush (stdout);
|
||||
#endif
|
||||
|
||||
if (filename)
|
||||
{
|
||||
path = filename_to_path (filename);
|
||||
@@ -1422,6 +1426,11 @@ gtk_file_folder_win32_list_children (GtkFileFolder *folder,
|
||||
*children = NULL;
|
||||
|
||||
dir = g_dir_open (folder_win32->filename, 0, error);
|
||||
|
||||
#if DEBUGGING_OUTPUT
|
||||
printf ("%s: %s: %s\n", __FUNCTION__, folder_win32->filename, dir?"OK":"FAIL"), fflush (stdout);
|
||||
#endif
|
||||
|
||||
if (!dir)
|
||||
return FALSE;
|
||||
|
||||
@@ -1516,9 +1525,7 @@ filename_get_info (const gchar *filename,
|
||||
|
||||
if (types & GTK_FILE_INFO_IS_HIDDEN)
|
||||
{
|
||||
/* Unix dot convention or the Windows hidden attribute */
|
||||
gboolean is_hidden = basename[0] == '.' ||
|
||||
!!(wfad.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN);
|
||||
gboolean is_hidden = !!(wfad.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN);
|
||||
gtk_file_info_set_is_hidden (info, is_hidden);
|
||||
}
|
||||
|
||||
@@ -1654,14 +1661,8 @@ filename_is_server_share (const char *filename)
|
||||
static gboolean
|
||||
filename_is_some_root (const char *filename)
|
||||
{
|
||||
#if 0
|
||||
return ((G_IS_DIR_SEPARATOR (filename[0]) && filename[1] == '\0') ||
|
||||
filename_is_server_share (filename) ||
|
||||
filename_is_drive_root (filename));
|
||||
#else
|
||||
return (g_path_is_absolute (filename) &&
|
||||
*(g_path_skip_root (filename)) == '\0');
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
+1
-1
@@ -869,7 +869,7 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
|
||||
#endif
|
||||
|
||||
style = NULL;
|
||||
if (font_button->priv->show_style)
|
||||
if (font_button->priv->show_style && family)
|
||||
{
|
||||
PangoFontFamily **families;
|
||||
PangoFontFace **faces;
|
||||
|
||||
+7
-2
@@ -1198,13 +1198,18 @@ gtk_font_selection_set_font_name (GtkFontSelection *fontsel,
|
||||
GtkTreeIter iter;
|
||||
GtkTreeIter match_iter;
|
||||
gboolean valid;
|
||||
const gchar *new_family_name;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_FONT_SELECTION (fontsel), FALSE);
|
||||
|
||||
new_desc = pango_font_description_from_string (fontname);
|
||||
|
||||
/* Check to make sure that this is in the list of allowed fonts */
|
||||
new_family_name = pango_font_description_get_family (new_desc);
|
||||
if (!new_family_name)
|
||||
return FALSE;
|
||||
|
||||
/* Check to make sure that this is in the list of allowed fonts
|
||||
*/
|
||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (fontsel->family_list));
|
||||
for (valid = gtk_tree_model_get_iter_first (model, &iter);
|
||||
valid;
|
||||
@@ -1215,7 +1220,7 @@ gtk_font_selection_set_font_name (GtkFontSelection *fontsel,
|
||||
gtk_tree_model_get (model, &iter, FAMILY_COLUMN, &family, -1);
|
||||
|
||||
if (g_ascii_strcasecmp (pango_font_family_get_name (family),
|
||||
pango_font_description_get_family (new_desc)) == 0)
|
||||
new_family_name) == 0)
|
||||
new_family = family;
|
||||
|
||||
g_object_unref (family);
|
||||
|
||||
@@ -378,8 +378,6 @@ _gtk_icon_cache_get_icon (GtkIconCache *cache,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixbuf = gdk_pixbuf_from_pixdata (&pixdata, FALSE, &error);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_data (pixdata.pixel_data, GDK_COLORSPACE_RGB,
|
||||
(pixdata.pixdata_type & GDK_PIXDATA_COLOR_TYPE_MASK) == GDK_PIXDATA_COLOR_TYPE_RGBA,
|
||||
8, pixdata.width, pixdata.height, pixdata.rowstride,
|
||||
|
||||
+16
-1
@@ -1484,6 +1484,21 @@ gtk_icon_theme_get_icon_sizes (GtkIconTheme *icon_theme,
|
||||
}
|
||||
}
|
||||
|
||||
if (icon_theme_builtin_icons)
|
||||
{
|
||||
GList *icons;
|
||||
|
||||
icons = g_hash_table_lookup (icon_theme_builtin_icons, icon_name);
|
||||
|
||||
while (icons)
|
||||
{
|
||||
BuiltinIcon *icon = icons->data;
|
||||
|
||||
g_hash_table_insert (sizes, GINT_TO_POINTER (icon->size), NULL);
|
||||
icons = icons->next;
|
||||
}
|
||||
}
|
||||
|
||||
r = result = g_new0 (gint, g_hash_table_size (sizes) + 1);
|
||||
|
||||
g_hash_table_foreach (sizes, add_size, &r);
|
||||
@@ -1893,7 +1908,7 @@ theme_lookup_icon (IconTheme *theme,
|
||||
if (min_dir)
|
||||
{
|
||||
GtkIconInfo *icon_info = icon_info_new ();
|
||||
gboolean has_icon_file;
|
||||
gboolean has_icon_file = FALSE;
|
||||
|
||||
suffix = theme_dir_get_icon_suffix (min_dir, icon_name, &has_icon_file);
|
||||
suffix = best_suffix (suffix, allow_svg);
|
||||
|
||||
+41
-30
@@ -697,10 +697,10 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* GtkIconView:orientation:
|
||||
* GtkIconView:reorderable:
|
||||
*
|
||||
* The reorderable property specifies if the items can be reordered
|
||||
* by DND.
|
||||
* by drag-and-drop.
|
||||
*
|
||||
* Since: 2.8
|
||||
*/
|
||||
@@ -1734,7 +1734,7 @@ gtk_icon_view_set_cursor (GtkIconView *icon_view,
|
||||
GtkCellRenderer *cell,
|
||||
gboolean start_editing)
|
||||
{
|
||||
GtkIconViewItem *item;
|
||||
GtkIconViewItem *item = NULL;
|
||||
GtkIconViewCellInfo *info = NULL;
|
||||
GList *l;
|
||||
gint i, cell_pos;
|
||||
@@ -1746,8 +1746,8 @@ gtk_icon_view_set_cursor (GtkIconView *icon_view,
|
||||
gtk_icon_view_stop_editing (icon_view, TRUE);
|
||||
|
||||
if (gtk_tree_path_get_depth (path) == 1)
|
||||
item = g_list_nth (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path)[0])->data;
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return;
|
||||
@@ -3930,7 +3930,7 @@ gtk_icon_view_move_cursor_start_end (GtkIconView *icon_view,
|
||||
* @path: The path of the item to move to.
|
||||
* @use_align: whether to use alignment arguments, or %FALSE.
|
||||
* @row_align: The vertical alignment of the item specified by @path.
|
||||
* @col_align: The horizontal alignment of the item specified by @column.
|
||||
* @col_align: The horizontal alignment of the item specified by @path.
|
||||
*
|
||||
* Moves the alignments of @icon_view to the position specified by @path.
|
||||
* @row_align determines where the row is placed, and @col_align determines where
|
||||
@@ -3988,7 +3988,7 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
|
||||
|
||||
if (use_align)
|
||||
{
|
||||
gint x, y, width, height;
|
||||
gint x, y;
|
||||
gint focus_width;
|
||||
gfloat offset, value;
|
||||
|
||||
@@ -4457,7 +4457,6 @@ gtk_icon_view_get_visible_range (GtkIconView *icon_view,
|
||||
{
|
||||
gint start_index = -1;
|
||||
gint end_index = -1;
|
||||
GtkIconViewItem *item;
|
||||
GList *icons;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
||||
@@ -4720,10 +4719,13 @@ update_text_cell (GtkIconView *icon_view)
|
||||
{
|
||||
if (icon_view->priv->text_cell != -1)
|
||||
{
|
||||
if (icon_view->priv->pixbuf_cell > icon_view->priv->text_cell)
|
||||
icon_view->priv->pixbuf_cell--;
|
||||
|
||||
info = g_list_nth_data (icon_view->priv->cell_list,
|
||||
icon_view->priv->text_cell);
|
||||
|
||||
g_list_remove (icon_view->priv->cell_list, info);
|
||||
icon_view->priv->cell_list = g_list_remove (icon_view->priv->cell_list, info);
|
||||
|
||||
free_cell_info (info);
|
||||
|
||||
@@ -4790,10 +4792,13 @@ update_pixbuf_cell (GtkIconView *icon_view)
|
||||
{
|
||||
if (icon_view->priv->pixbuf_cell != -1)
|
||||
{
|
||||
if (icon_view->priv->text_cell > icon_view->priv->pixbuf_cell)
|
||||
icon_view->priv->text_cell--;
|
||||
|
||||
info = g_list_nth_data (icon_view->priv->cell_list,
|
||||
icon_view->priv->pixbuf_cell);
|
||||
|
||||
g_list_remove (icon_view->priv->cell_list, info);
|
||||
icon_view->priv->cell_list = g_list_remove (icon_view->priv->cell_list, info);
|
||||
|
||||
free_cell_info (info);
|
||||
|
||||
@@ -5074,8 +5079,8 @@ gtk_icon_view_unselect_path (GtkIconView *icon_view,
|
||||
g_return_if_fail (icon_view->priv->model != NULL);
|
||||
g_return_if_fail (path != NULL);
|
||||
|
||||
item = g_list_nth (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path)[0])->data;
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return;
|
||||
@@ -5207,8 +5212,8 @@ gtk_icon_view_path_is_selected (GtkIconView *icon_view,
|
||||
g_return_val_if_fail (icon_view->priv->model != NULL, FALSE);
|
||||
g_return_val_if_fail (path != NULL, FALSE);
|
||||
|
||||
item = g_list_nth (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path)[0])->data;
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return FALSE;
|
||||
@@ -6480,7 +6485,7 @@ gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view)
|
||||
* gtk_icon_view_set_drag_dest_item:
|
||||
* @icon_view: a #GtkIconView
|
||||
* @path: The path of the item to highlight, or %NULL.
|
||||
* @pos: Specifies whether to drop, relative to the item
|
||||
* @pos: Specifies where to drop, relative to the item
|
||||
*
|
||||
* Sets the item that is highlighted for feedback.
|
||||
*
|
||||
@@ -6569,7 +6574,7 @@ gtk_icon_view_get_drag_dest_item (GtkIconView *icon_view,
|
||||
* @icon_view: a #GtkIconView
|
||||
* @drag_x: the position to determine the destination item for
|
||||
* @drag_y: the position to determine the destination item for
|
||||
* @path: Return location for the path of the highlighted item, or %NULL.
|
||||
* @path: Return location for the path of the item, or %NULL.
|
||||
* @pos: Return location for the drop position, or %NULL
|
||||
*
|
||||
* Determines the destination item for a given position.
|
||||
@@ -6651,8 +6656,14 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
|
||||
gint index;
|
||||
GdkRectangle area;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), NULL);
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
|
||||
widget = GTK_WIDGET (icon_view);
|
||||
|
||||
if (!GTK_WIDGET_REALIZED (widget))
|
||||
return NULL;
|
||||
|
||||
index = gtk_tree_path_get_indices (path)[0];
|
||||
|
||||
for (l = icon_view->priv->items; l; l = l->next)
|
||||
@@ -7135,6 +7146,7 @@ gtk_icon_view_item_accessible_text_get_character_at_offset (AtkText *text,
|
||||
return unichar;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
get_pango_text_offsets (PangoLayout *layout,
|
||||
GtkTextBuffer *buffer,
|
||||
@@ -7257,6 +7269,7 @@ get_pango_text_offsets (PangoLayout *layout,
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, start_iter, *start_offset);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, end_iter, *end_offset);
|
||||
}
|
||||
#endif
|
||||
|
||||
static gchar*
|
||||
gtk_icon_view_item_accessible_text_get_text_before_offset (AtkText *text,
|
||||
@@ -7612,9 +7625,11 @@ gtk_icon_view_item_accessible_text_get_character_extents (AtkText *text,
|
||||
{
|
||||
GtkIconViewItemAccessible *item;
|
||||
GtkIconView *icon_view;
|
||||
#if 0
|
||||
PangoRectangle char_rect;
|
||||
const gchar *item_text;
|
||||
gint index;
|
||||
#endif
|
||||
|
||||
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
||||
|
||||
@@ -7650,10 +7665,12 @@ gtk_icon_view_item_accessible_text_get_offset_at_point (AtkText *text,
|
||||
{
|
||||
GtkIconViewItemAccessible *item;
|
||||
GtkIconView *icon_view;
|
||||
gint offset = -1;
|
||||
#if 0
|
||||
const gchar *item_text;
|
||||
gint index;
|
||||
gint offset;
|
||||
gint l_x, l_y;
|
||||
#endif
|
||||
|
||||
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
||||
|
||||
@@ -8469,7 +8486,6 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
|
||||
GtkIconView *icon_view;
|
||||
GtkIconViewItemAccessible *item;
|
||||
GList *items;
|
||||
GList *tmp_list;
|
||||
AtkObject *atk_obj;
|
||||
|
||||
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
||||
@@ -8478,14 +8494,12 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
|
||||
priv = gtk_icon_view_accessible_get_priv (atk_obj);
|
||||
|
||||
items = priv->items;
|
||||
tmp_list = NULL;
|
||||
while (items)
|
||||
{
|
||||
info = items->data;
|
||||
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
|
||||
info->index = new_order[info->index];
|
||||
tmp_list = g_list_nth (icon_view->priv->items, info->index);
|
||||
item->item = tmp_list->data;
|
||||
item->item = g_list_nth_data (icon_view->priv->items, info->index);
|
||||
items = items->next;
|
||||
}
|
||||
priv->items = g_list_sort (priv->items,
|
||||
@@ -8752,7 +8766,6 @@ gtk_icon_view_accessible_add_selection (AtkSelection *selection,
|
||||
GtkWidget *widget;
|
||||
GtkIconView *icon_view;
|
||||
GtkIconViewItem *item;
|
||||
GList *l;
|
||||
|
||||
widget = GTK_ACCESSIBLE (selection)->widget;
|
||||
if (widget == NULL)
|
||||
@@ -8760,11 +8773,11 @@ gtk_icon_view_accessible_add_selection (AtkSelection *selection,
|
||||
|
||||
icon_view = GTK_ICON_VIEW (widget);
|
||||
|
||||
l = g_list_nth (icon_view->priv->items, i);
|
||||
if (!l)
|
||||
item = g_list_nth_data (icon_view->priv->items, i);
|
||||
|
||||
if (!item)
|
||||
return FALSE;
|
||||
|
||||
item = l->data;
|
||||
gtk_icon_view_select_item (icon_view, item);
|
||||
|
||||
return TRUE;
|
||||
@@ -8855,18 +8868,16 @@ gtk_icon_view_accessible_is_child_selected (AtkSelection *selection,
|
||||
GtkWidget *widget;
|
||||
GtkIconView *icon_view;
|
||||
GtkIconViewItem *item;
|
||||
GList *l;
|
||||
|
||||
widget = GTK_ACCESSIBLE (selection)->widget;
|
||||
if (widget == NULL)
|
||||
return FALSE;
|
||||
|
||||
icon_view = GTK_ICON_VIEW (widget);
|
||||
l = g_list_nth (icon_view->priv->items, i);
|
||||
if (!l)
|
||||
return FALSE;
|
||||
|
||||
item = l->data;
|
||||
item = g_list_nth_data (icon_view->priv->items, i);
|
||||
if (!item)
|
||||
return FALSE;
|
||||
|
||||
return item->selected;
|
||||
}
|
||||
|
||||
+14
-16
@@ -1774,22 +1774,17 @@ gtk_image_expose (GtkWidget *widget,
|
||||
}
|
||||
|
||||
if (pixbuf)
|
||||
{
|
||||
gdk_draw_pixbuf (widget->window,
|
||||
widget->style->black_gc,
|
||||
pixbuf,
|
||||
image_bound.x - x,
|
||||
image_bound.y - y,
|
||||
image_bound.x,
|
||||
image_bound.y,
|
||||
image_bound.width,
|
||||
image_bound.height,
|
||||
GDK_RGB_DITHER_NORMAL,
|
||||
0, 0);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
pixbuf = NULL;
|
||||
}
|
||||
gdk_draw_pixbuf (widget->window,
|
||||
widget->style->black_gc,
|
||||
pixbuf,
|
||||
image_bound.x - x,
|
||||
image_bound.y - y,
|
||||
image_bound.x,
|
||||
image_bound.y,
|
||||
image_bound.width,
|
||||
image_bound.height,
|
||||
GDK_RGB_DITHER_NORMAL,
|
||||
0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1830,6 +1825,9 @@ gtk_image_expose (GtkWidget *widget,
|
||||
gdk_gc_set_clip_mask (widget->style->black_gc, NULL);
|
||||
gdk_gc_set_clip_origin (widget->style->black_gc, 0, 0);
|
||||
}
|
||||
|
||||
if (pixbuf)
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
} /* if widget is drawable */
|
||||
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ gtk_im_module_load (GTypeModule *module)
|
||||
{
|
||||
GtkIMModule *im_module = GTK_IM_MODULE (module);
|
||||
|
||||
im_module->library = g_module_open (im_module->path, 0);
|
||||
im_module->library = g_module_open (im_module->path, G_MODULE_BIND_LAZY);
|
||||
if (!im_module->library)
|
||||
{
|
||||
g_warning (g_module_error());
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef __GTKINTL_H__
|
||||
#define __GTKINTL_H__
|
||||
|
||||
#include "config.h"
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
|
||||
+13
-4
@@ -297,9 +297,18 @@ _gtk_get_localedir (void)
|
||||
{
|
||||
static char *gtk_localedir = NULL;
|
||||
if (gtk_localedir == NULL)
|
||||
gtk_localedir = g_win32_get_package_installation_subdirectory
|
||||
(GETTEXT_PACKAGE, dll_name, "lib\\locale");
|
||||
{
|
||||
gchar *temp;
|
||||
|
||||
temp = g_win32_get_package_installation_subdirectory
|
||||
(GETTEXT_PACKAGE, dll_name, "lib\\locale");
|
||||
|
||||
/* gtk_localedir is passed to bindtextdomain() which isn't
|
||||
* UTF-8-aware.
|
||||
*/
|
||||
gtk_localedir = g_win32_locale_filename_from_utf8 (temp);
|
||||
g_free (temp);
|
||||
}
|
||||
return gtk_localedir;
|
||||
}
|
||||
|
||||
@@ -1256,7 +1265,7 @@ gtk_main_do_event (GdkEvent *event)
|
||||
* in the user_data field of GdkWindow's.
|
||||
* Ignore the event if we don't have a widget for it, except
|
||||
* for GDK_PROPERTY_NOTIFY events which are handled specialy.
|
||||
* Though this happens rarely, bogus events can occour
|
||||
* Though this happens rarely, bogus events can occur
|
||||
* for e.g. destroyed GdkWindows.
|
||||
*/
|
||||
event_widget = gtk_get_event_widget (event);
|
||||
@@ -2044,7 +2053,7 @@ gtk_get_event_widget (GdkEvent *event)
|
||||
|
||||
widget = NULL;
|
||||
if (event && event->any.window &&
|
||||
!GDK_WINDOW_DESTROYED (event->any.window))
|
||||
(event->type == GDK_DESTROY || !GDK_WINDOW_DESTROYED (event->any.window)))
|
||||
gdk_window_get_user_data (event->any.window, (void**) &widget);
|
||||
|
||||
return widget;
|
||||
|
||||
@@ -88,6 +88,7 @@ VOID:OBJECT,STRING
|
||||
VOID:POINTER
|
||||
VOID:POINTER,INT
|
||||
VOID:POINTER,BOOLEAN
|
||||
VOID:POINTER,POINTER,BOOLEAN
|
||||
VOID:POINTER,POINTER,POINTER
|
||||
VOID:POINTER,UINT
|
||||
VOID:STRING
|
||||
|
||||
+1
-1
@@ -4419,7 +4419,7 @@ gtk_menu_grab_notify (GtkWidget *widget,
|
||||
|
||||
if (!was_grabbed)
|
||||
{
|
||||
if (!GTK_IS_MENU_SHELL (grab))
|
||||
if (GTK_MENU_SHELL (widget)->active && !GTK_IS_MENU_SHELL (grab))
|
||||
gtk_menu_shell_cancel (GTK_MENU_SHELL (widget));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,6 +307,7 @@ menu_position_func (GtkMenu *menu,
|
||||
{
|
||||
gdk_window_get_origin (widget->window, x, y);
|
||||
*x += widget->allocation.x;
|
||||
*y += widget->allocation.y;
|
||||
|
||||
if (direction == GTK_TEXT_DIR_LTR)
|
||||
*x += MAX (widget->allocation.width - menu_req.width, 0);
|
||||
|
||||
@@ -472,7 +472,7 @@ gtk_message_dialog_new (GtkWindow *parent,
|
||||
* dialog = gtk_message_dialog_new (main_application_window,
|
||||
* GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
* GTK_MESSAGE_ERROR,
|
||||
* GTK_BUTTON_CLOSE,
|
||||
* GTK_BUTTONS_CLOSE,
|
||||
* NULL);
|
||||
* gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
|
||||
* markup);
|
||||
|
||||
+25
-5
@@ -130,6 +130,8 @@ static gboolean gtk_paned_cancel_position (GtkPaned *paned);
|
||||
static gboolean gtk_paned_toggle_handle_focus (GtkPaned *paned);
|
||||
|
||||
static GType gtk_paned_child_type (GtkContainer *container);
|
||||
static void gtk_paned_grab_notify (GtkWidget *widget,
|
||||
gboolean was_grabbed);
|
||||
|
||||
static GtkContainerClass *parent_class = NULL;
|
||||
|
||||
@@ -223,6 +225,7 @@ gtk_paned_class_init (GtkPanedClass *class)
|
||||
widget_class->button_release_event = gtk_paned_button_release;
|
||||
widget_class->motion_notify_event = gtk_paned_motion;
|
||||
widget_class->grab_broken_event = gtk_paned_grab_broken;
|
||||
widget_class->grab_notify = gtk_paned_grab_notify;
|
||||
|
||||
container_class->add = gtk_paned_add;
|
||||
container_class->remove = gtk_paned_remove;
|
||||
@@ -925,6 +928,26 @@ gtk_paned_grab_broken (GtkWidget *widget,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
stop_drag (GtkPaned *paned)
|
||||
{
|
||||
paned->in_drag = FALSE;
|
||||
paned->drag_pos = -1;
|
||||
paned->position_set = TRUE;
|
||||
gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (paned)),
|
||||
paned->priv->grab_time);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_paned_grab_notify (GtkWidget *widget,
|
||||
gboolean was_grabbed)
|
||||
{
|
||||
GtkPaned *paned = GTK_PANED (widget);
|
||||
|
||||
if (!was_grabbed && paned->in_drag)
|
||||
stop_drag (paned);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_paned_button_release (GtkWidget *widget,
|
||||
GdkEventButton *event)
|
||||
@@ -933,11 +956,8 @@ gtk_paned_button_release (GtkWidget *widget,
|
||||
|
||||
if (paned->in_drag && (event->button == 1))
|
||||
{
|
||||
paned->in_drag = FALSE;
|
||||
paned->drag_pos = -1;
|
||||
paned->position_set = TRUE;
|
||||
gdk_display_pointer_ungrab (gtk_widget_get_display (widget),
|
||||
paned->priv->grab_time);
|
||||
stop_drag (paned);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
+36
-22
@@ -127,6 +127,7 @@ get_slider_button (GtkPathBar *path_bar,
|
||||
gtk_widget_push_composite_child ();
|
||||
|
||||
button = gtk_button_new ();
|
||||
gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (arrow_type, GTK_SHADOW_OUT));
|
||||
gtk_container_add (GTK_CONTAINER (path_bar), button);
|
||||
gtk_widget_show_all (button);
|
||||
@@ -192,8 +193,9 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (GtkPathBarClass, path_clicked),
|
||||
NULL, NULL,
|
||||
_gtk_marshal_VOID__POINTER_BOOLEAN,
|
||||
G_TYPE_NONE, 2,
|
||||
_gtk_marshal_VOID__POINTER_POINTER_BOOLEAN,
|
||||
G_TYPE_NONE, 3,
|
||||
G_TYPE_POINTER,
|
||||
G_TYPE_POINTER,
|
||||
G_TYPE_BOOLEAN);
|
||||
}
|
||||
@@ -307,13 +309,19 @@ gtk_path_bar_update_slider_buttons (GtkPathBar *path_bar)
|
||||
|
||||
button = BUTTON_DATA (path_bar->button_list->data)->button;
|
||||
if (gtk_widget_get_child_visible (button))
|
||||
gtk_widget_set_sensitive (path_bar->down_slider_button, FALSE);
|
||||
{
|
||||
gtk_path_bar_stop_scrolling (path_bar);
|
||||
gtk_widget_set_sensitive (path_bar->down_slider_button, FALSE);
|
||||
}
|
||||
else
|
||||
gtk_widget_set_sensitive (path_bar->down_slider_button, TRUE);
|
||||
|
||||
button = BUTTON_DATA (g_list_last (path_bar->button_list)->data)->button;
|
||||
if (gtk_widget_get_child_visible (button))
|
||||
gtk_widget_set_sensitive (path_bar->up_slider_button, FALSE);
|
||||
{
|
||||
gtk_path_bar_stop_scrolling (path_bar);
|
||||
gtk_widget_set_sensitive (path_bar->up_slider_button, FALSE);
|
||||
}
|
||||
else
|
||||
gtk_widget_set_sensitive (path_bar->up_slider_button, TRUE);
|
||||
}
|
||||
@@ -732,9 +740,9 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
|
||||
|
||||
if (path_bar->timer)
|
||||
{
|
||||
if (GTK_WIDGET_HAS_FOCUS (path_bar->up_slider_button))
|
||||
if (path_bar->scrolling_up)
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
else if (GTK_WIDGET_HAS_FOCUS (path_bar->down_slider_button))
|
||||
else if (path_bar->scrolling_down)
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
|
||||
if (path_bar->need_timer)
|
||||
@@ -772,18 +780,23 @@ gtk_path_bar_slider_button_press (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
GtkPathBar *path_bar)
|
||||
{
|
||||
if (!GTK_WIDGET_HAS_FOCUS (widget))
|
||||
gtk_widget_grab_focus (widget);
|
||||
|
||||
if (event->type != GDK_BUTTON_PRESS || event->button != 1)
|
||||
return FALSE;
|
||||
|
||||
path_bar->ignore_click = FALSE;
|
||||
|
||||
if (widget == path_bar->up_slider_button)
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
else if (widget == path_bar->down_slider_button)
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
{
|
||||
path_bar->scrolling_down = FALSE;
|
||||
path_bar->scrolling_up = TRUE;
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
}
|
||||
else if (widget == path_bar->down_slider_button)
|
||||
{
|
||||
path_bar->scrolling_up = FALSE;
|
||||
path_bar->scrolling_down = TRUE;
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
}
|
||||
|
||||
if (!path_bar->timer)
|
||||
{
|
||||
@@ -928,6 +941,7 @@ button_clicked_cb (GtkWidget *button,
|
||||
GtkPathBar *path_bar;
|
||||
GList *button_list;
|
||||
gboolean child_is_hidden;
|
||||
GtkFilePath *child_path;
|
||||
|
||||
button_data = BUTTON_DATA (data);
|
||||
if (button_data->ignore_changes)
|
||||
@@ -945,12 +959,17 @@ button_clicked_cb (GtkWidget *button,
|
||||
ButtonData *child_data;
|
||||
|
||||
child_data = BUTTON_DATA (button_list->prev->data);
|
||||
child_path = child_data->path;
|
||||
child_is_hidden = child_data->file_is_hidden;
|
||||
}
|
||||
else
|
||||
child_is_hidden = FALSE;
|
||||
{
|
||||
child_path = NULL;
|
||||
child_is_hidden = FALSE;
|
||||
}
|
||||
|
||||
g_signal_emit (path_bar, path_bar_signals [PATH_CLICKED], 0, button_data->path, child_is_hidden);
|
||||
g_signal_emit (path_bar, path_bar_signals [PATH_CLICKED], 0,
|
||||
button_data->path, child_path, child_is_hidden);
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
@@ -1016,13 +1035,7 @@ button_data_free (ButtonData *button_data)
|
||||
static const char *
|
||||
get_dir_name (ButtonData *button_data)
|
||||
{
|
||||
if (button_data->type == HOME_BUTTON)
|
||||
return _("Home");
|
||||
else if (button_data->type == DESKTOP_BUTTON)
|
||||
return _("Desktop");
|
||||
else
|
||||
return button_data->dir_name;
|
||||
|
||||
return button_data->dir_name;
|
||||
}
|
||||
|
||||
/* We always want to request the same size for the label, whether
|
||||
@@ -1129,7 +1142,7 @@ button_drag_data_get_cb (GtkWidget *widget,
|
||||
gtk_selection_data_set (selection_data,
|
||||
selection_data->target,
|
||||
8,
|
||||
uri_list,
|
||||
(guchar *)uri_list,
|
||||
strlen (uri_list));
|
||||
g_free (uri_list);
|
||||
}
|
||||
@@ -1155,6 +1168,7 @@ make_directory_button (GtkPathBar *path_bar,
|
||||
|
||||
button_data->type = find_button_type (path_bar, path);
|
||||
button_data->button = gtk_toggle_button_new ();
|
||||
gtk_button_set_focus_on_click (GTK_BUTTON (button_data->button), FALSE);
|
||||
|
||||
switch (button_data->type)
|
||||
{
|
||||
|
||||
+5
-2
@@ -61,8 +61,10 @@ struct _GtkPathBar
|
||||
gint16 button_offset;
|
||||
guint timer;
|
||||
guint slider_visible : 1;
|
||||
guint need_timer : 1;
|
||||
guint ignore_click : 1;
|
||||
guint need_timer : 1;
|
||||
guint ignore_click : 1;
|
||||
guint scrolling_up : 1;
|
||||
guint scrolling_down : 1;
|
||||
};
|
||||
|
||||
struct _GtkPathBarClass
|
||||
@@ -71,6 +73,7 @@ struct _GtkPathBarClass
|
||||
|
||||
void (* path_clicked) (GtkPathBar *path_bar,
|
||||
GtkFilePath *file_path,
|
||||
GtkFilePath *child_path,
|
||||
gboolean child_is_hidden);
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -259,7 +259,7 @@ _gtk_plug_add_to_socket (GtkPlug *plug,
|
||||
|
||||
/**
|
||||
* _gtk_plug_send_delete_event:
|
||||
* widget: a #GtkWidget
|
||||
* @widget: a #GtkWidget
|
||||
*
|
||||
* Send a GDK_DELETE event to the @widget and destroy it if
|
||||
* necessary. Internal GTK function, called from this file or the
|
||||
|
||||
+1
-1
@@ -472,7 +472,7 @@ _gtk_rbtree_free (GtkRBTree *tree)
|
||||
if (tree->parent_node &&
|
||||
tree->parent_node->children == tree)
|
||||
tree->parent_node->children = NULL;
|
||||
_gtk_rbnode_free (tree->nil);
|
||||
g_free (tree->nil);
|
||||
g_free (tree);
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1324,8 +1324,9 @@ gtk_rc_reset_widgets (GtkSettings *settings)
|
||||
if (gtk_widget_get_screen (list->data) == settings->screen)
|
||||
{
|
||||
gtk_widget_reset_rc_styles (list->data);
|
||||
g_object_unref (list->data);
|
||||
}
|
||||
|
||||
g_object_unref (list->data);
|
||||
}
|
||||
g_list_free (toplevels);
|
||||
}
|
||||
@@ -1464,7 +1465,7 @@ gtk_rc_reparse_all_for_settings (GtkSettings *settings,
|
||||
if (!rc_file->is_string)
|
||||
{
|
||||
if (!g_lstat (rc_file->name, &statbuf) &&
|
||||
(statbuf.st_mtime > rc_file->mtime))
|
||||
(statbuf.st_mtime != rc_file->mtime))
|
||||
{
|
||||
mtime_modified = TRUE;
|
||||
break;
|
||||
|
||||
+2
-2
@@ -646,8 +646,8 @@ _gtk_scale_format_value (GtkScale *scale,
|
||||
if (fmt)
|
||||
return fmt;
|
||||
else
|
||||
return g_strdup_printf ("%0.*f", scale->digits,
|
||||
value);
|
||||
/* insert a LRM, to prevent -20 to come out as 20- in RTL locales */
|
||||
return g_strdup_printf ("\342\200\216%0.*f", scale->digits, value);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+10
-6
@@ -1415,16 +1415,16 @@ gtk_selection_data_get_pixbuf (GtkSelectionData *selection_data)
|
||||
{
|
||||
loader = gdk_pixbuf_loader_new ();
|
||||
|
||||
if (gdk_pixbuf_loader_write (loader,
|
||||
selection_data->data,
|
||||
selection_data->length,
|
||||
NULL))
|
||||
result = gdk_pixbuf_loader_get_pixbuf (loader);
|
||||
gdk_pixbuf_loader_write (loader,
|
||||
selection_data->data,
|
||||
selection_data->length,
|
||||
NULL);
|
||||
gdk_pixbuf_loader_close (loader, NULL);
|
||||
result = gdk_pixbuf_loader_get_pixbuf (loader);
|
||||
|
||||
if (result)
|
||||
g_object_ref (result);
|
||||
|
||||
gdk_pixbuf_loader_close (loader, NULL);
|
||||
g_object_unref (loader);
|
||||
}
|
||||
|
||||
@@ -1475,6 +1475,8 @@ gtk_selection_data_set_uris (GtkSelectionData *selection_data,
|
||||
gtk_selection_data_set (selection_data,
|
||||
text_uri_list_atom,
|
||||
8, (guchar *)result, length);
|
||||
|
||||
g_free (result);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1831,6 +1833,8 @@ _gtk_selection_request (GtkWidget *widget,
|
||||
info->conversions[i].property = gdk_x11_xatom_to_atom_for_display (display,
|
||||
((glong *)mult_atoms)[2*i + 1]);
|
||||
}
|
||||
|
||||
g_free (mult_atoms);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -1371,6 +1371,8 @@ settings_update_cursor_theme (GtkSettings *settings)
|
||||
NULL);
|
||||
|
||||
gdk_x11_display_set_cursor_theme (display, theme, size);
|
||||
|
||||
g_free (theme);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+4
-4
@@ -97,13 +97,13 @@ _gtk_socket_windowing_size_request (GtkSocket *socket)
|
||||
{
|
||||
if (hints.flags & PMinSize)
|
||||
{
|
||||
socket->request_width = hints.min_width;
|
||||
socket->request_height = hints.min_height;
|
||||
socket->request_width = MAX (hints.min_width, 1);
|
||||
socket->request_height = MAX (hints.min_height, 1);
|
||||
}
|
||||
else if (hints.flags & PBaseSize)
|
||||
{
|
||||
socket->request_width = hints.base_width;
|
||||
socket->request_height = hints.base_height;
|
||||
socket->request_width = MAX (hints.base_width, 1);
|
||||
socket->request_height = MAX (hints.base_height, 1);
|
||||
}
|
||||
}
|
||||
socket->have_size = TRUE;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user