Compare commits
450 Commits
3.10.7
...
GTK_2_8_13
| Author | SHA1 | Date | |
|---|---|---|---|
| 804989eb14 | |||
| 074333942b | |||
| 0e7f4d589c | |||
| 0ffe14c6f1 | |||
| 64c823eea4 | |||
| f603303de0 | |||
| c2259c7d17 | |||
| cba2d34927 | |||
| f9a9726691 | |||
| 17a389280a | |||
| 418d1f8fe8 | |||
| b7657627a2 | |||
| ec838304c6 | |||
| c8d48a9df4 | |||
| 312b36609a | |||
| bdccc3fd1b | |||
| 4d31b716d5 | |||
| d9b1d820db | |||
| 8af4ae1969 | |||
| 2a3810c3c5 | |||
| 7657870ba2 | |||
| b4e6e8fe52 | |||
| 8734bf8bc1 | |||
| 019a24adbe | |||
| 9a9dd1b5eb | |||
| 98689ebb90 | |||
| b7fe6a8932 | |||
| f0187a9fe8 | |||
| 81ef262dff | |||
| 82fd3665ff | |||
| 567eb53e2c | |||
| 846082d7e9 | |||
| e13264939d | |||
| 8dee85c78f | |||
| 22f85debbe | |||
| 75d186d622 | |||
| 957c5f0271 | |||
| f8cf7a3da8 | |||
| 70c468374f | |||
| 86bf974f5e | |||
| db673f0601 | |||
| 6fbe064c50 | |||
| ab34c90bc8 | |||
| ae109b239e | |||
| 80b7f28196 | |||
| 3f9ea3ca8d | |||
| 6eda42cf2c | |||
| 32beb41ee3 | |||
| ed50efa126 | |||
| 77b3ba3efe | |||
| 95287bcaba | |||
| 544eea3561 | |||
| 3d05b7c76b | |||
| 6349d10ea2 | |||
| d0d686eec3 | |||
| 6c2be9244b | |||
| 6298981815 | |||
| 57259b1a82 | |||
| a3482bfc4c | |||
| 7ee9b7cec7 | |||
| 31c60854a8 | |||
| 304cec307a | |||
| 566e1f38b1 | |||
| 85b61ac092 | |||
| 17b077c6c3 | |||
| 49bd646225 | |||
| 31a41ccf27 | |||
| c7f548984c | |||
| e7be150752 | |||
| 9bdf99b219 | |||
| acc3f3afdb | |||
| 0f762f13c0 | |||
| a1cb4e7d81 | |||
| d8711720a3 | |||
| fed4bafdbd | |||
| c9473ebd35 | |||
| d8a5439f4d | |||
| 7a83f3cf44 | |||
| d8123eed06 | |||
| 3d5a0db24b | |||
| c123513ba8 | |||
| 85af879562 | |||
| c5d32ae04c | |||
| 2e3c08765a | |||
| 42b0e4460d | |||
| 2b0a6009af | |||
| cadbf07d53 | |||
| e14a4cd0c1 | |||
| 43be0bb532 | |||
| 7b428f0215 | |||
| ed07d77d56 | |||
| 0cb610fbee | |||
| d66efae8e0 | |||
| fdf0afc1c2 | |||
| 1bae6cdf3d | |||
| 07887a259d | |||
| a05c0e2985 | |||
| 6f2ece32ae | |||
| 8f34c4566a | |||
| 1694f20422 | |||
| 610e9628e0 | |||
| 9bddf4d83b | |||
| 90c910e244 | |||
| 7aeb1bb515 | |||
| 98179253db | |||
| 1583ef9c21 | |||
| 445bee04e3 | |||
| 4a784ff2f9 | |||
| cc346bfdb4 | |||
| a3e8e32299 | |||
| 9ddec60c3a | |||
| 42edcf8a77 | |||
| a9be5ddf14 | |||
| 826ee8cf39 | |||
| 1a51d66459 | |||
| 01cc3a42ca | |||
| a0ae4d95fd | |||
| de25ca5ebc | |||
| 11a1ada618 | |||
| 91c83ea4f0 | |||
| fdbf1f36a5 | |||
| 41b718b24d | |||
| 01c32828f0 | |||
| aa79f10539 | |||
| 5acd528ee6 | |||
| e1e6c7ddf1 | |||
| 7a33528133 | |||
| 5a3c267b79 | |||
| dad73781b7 | |||
| 3750d5da6b | |||
| 280769a542 | |||
| bd3c206d76 | |||
| 147d53a883 | |||
| 05abc38a5c | |||
| 38a4720d7a | |||
| 29f78aaaa2 | |||
| cd7dee798b | |||
| 80732f59bf | |||
| ea7f2b23d0 | |||
| 4bdac8d5fb | |||
| 5176fa307f | |||
| b0b106dbe0 | |||
| 0979f16b36 | |||
| 0de720551c | |||
| 8c877d6688 | |||
| 2d5b575ea0 | |||
| 5cfa6eece0 | |||
| 077d0fe81f | |||
| d564a49fc2 | |||
| da3d56fc1a | |||
| 928a0da8d2 | |||
| 4e40304798 | |||
| 2da547c535 | |||
| 7881702108 | |||
| 31fe7a4f10 | |||
| 5a6c501d30 | |||
| 5b8d9bfc84 | |||
| fc5a193edf | |||
| ee9f3aed90 | |||
| e0e19dd998 | |||
| 9eb8b2af91 | |||
| e0ee2c256f | |||
| c3624ad401 | |||
| dca0fb1fa2 | |||
| d70a7476cd | |||
| f1e45e5fc2 | |||
| 05c3415a5b | |||
| 0aebad6b4b | |||
| 37fd53219d | |||
| 869351ad8a | |||
| 0ba88e0fb0 | |||
| 61b892d23e | |||
| 3584677939 | |||
| b7b750b05b | |||
| e6a5410fb5 | |||
| 241fd6dda6 | |||
| 34e5c8510c | |||
| 3fac9f99fc | |||
| 7b799ca14d | |||
| fb3555ebd6 | |||
| be436ea53f | |||
| afd5ed8095 | |||
| 13ed5fef8d | |||
| 0d4a99ded5 | |||
| 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 |
+1810
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.13.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.8.13 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
|
||||
@@ -1,3 +1,345 @@
|
||||
Overview of Changes from GTK+ 2.8.12 to GTK+ 2.8.13
|
||||
===================================================
|
||||
|
||||
* Bugs fixed:
|
||||
330732 Can't select some items in GtkIconView [Donald Straney]
|
||||
330944 gtk_icon_theme_list_icons: example contexts don't work
|
||||
[John Spray]
|
||||
331097 gnopernicus crashes on changing display screen source
|
||||
for magnifier [Oana Serb]
|
||||
331467 evince crashes in gdk_region_union_with_rect [Benjamin Berg]
|
||||
331820 Small error in _gdk_gc_update_context [Matthias]
|
||||
331785 gtk.Notebook.get_current_page() returns incorrect page
|
||||
number when pages hidden [Sebastien Bacher]
|
||||
331940 GtkAboutDialog not responsive to Escape key [Daniel Drake]
|
||||
331440 GtkNotebook popup menu not keynavigatable [Paolo Borelli]
|
||||
331651 GtkRadioButton does not issue notify::active
|
||||
332059 Make more use of G_DISABLE_ASSERT in TextView code
|
||||
[Arnaud Charlet]
|
||||
|
||||
* Updated translations (eu,ka,uk)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.8.11 to GTK+ 2.8.12
|
||||
===================================================
|
||||
|
||||
* The font picker button can now display fractional
|
||||
font sizes [Ross Burton]
|
||||
|
||||
* Updates for the windows theme [Dom Lachowicz]
|
||||
|
||||
* Workaround for cairo hitting a slow path in the
|
||||
X server [Federico Mena Quintero]
|
||||
|
||||
* Bugs fixed:
|
||||
145243 root window drag FROM testdnd not working [Andrew S. Dixon]
|
||||
321054 Pointer grabs misbehave on Win32 [Tor Lillqvist]
|
||||
322042 Buggy RTL support in ellipsized labels [Behdad Esfahbod]
|
||||
325521 enter_notify_event are not received on popup
|
||||
window in Win32 [Tor Lillqvist]
|
||||
327217 set_decorations() is overridden by window type
|
||||
hint [John Ehresman]
|
||||
327375 accept_focus isn't respected [John Ehresman]
|
||||
328820 they keypad '/' key should open the "open location"
|
||||
dialog [Federico Mena Quintero]
|
||||
329144 critical in gtk_widget_event [Wouter Bolsterlee]
|
||||
329124 distclean removes README [Kjartan Maraas, Tim Janik]
|
||||
329208 unsetting the "active" property of GtkToggleToolButton
|
||||
doesn't work properly [Guillaume Cottenceau]
|
||||
329876 Crash in gtktreemodelfilter.c when using gtk-demo
|
||||
with file picker [Kristian Rietveld]
|
||||
329099 gtk_misc_set_padding fails with labels in RTL
|
||||
locales [Hooman Mesgary]
|
||||
330022 Wrong pixel values in rsvg_cairo_render_image [Dom Lachowicz]
|
||||
330177 gtk_entry_completion_match_selected generates a critical
|
||||
warning when completion model is empty [Raphael Slinckx]
|
||||
330389 gtk_file_info_copy corrupts memory [Markku Vire]
|
||||
330563 image loaders don't check callbacks for NULL [Benjamin Otte]
|
||||
|
||||
* Documentation improvements [Ross Burton, Murray Cumming,
|
||||
Mart Raudsepp, Federico Mena Quintero, Milosz Derezynski]
|
||||
|
||||
* Translation updates (cy,lt,nl,pt,ru,sr,sr@Latn,vi)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.8.10 to GTK+ 2.8.11
|
||||
===================================================
|
||||
|
||||
* Avoid memory overruns in the pixbuf theme engine
|
||||
with nonsensical gradient specifications. [Matthias]
|
||||
|
||||
* Bugs fixed:
|
||||
326003 Cursor doesn't move as expected [Evert Verhellen]
|
||||
326806 Segfault from combination of gtk_container_set_resize_mode()
|
||||
and GtkComboBox [Sebastien Bacher]
|
||||
327751 segfault in update_cursor on amd64 [Ryan Lovett]
|
||||
327538 eog crashes at launch under AIX [Christophe Belle]
|
||||
153213 "~" should bring up the location dialog [Dan Winship]
|
||||
327934 gtk_text_layout_get_cursor_locations() chokes on
|
||||
layout=0x0 [Christian Kirbach]
|
||||
|
||||
* Documentation improvements [Federico Mena Quintero]
|
||||
|
||||
* Translation updates (es,pt_BR,zh_HK,zh_TW)
|
||||
|
||||
Overview of Changes from GTK+ 2.8.9 to GTK+ 2.8.10
|
||||
==================================================
|
||||
* Derive GtkObject from GInitiallyUnowned instead of
|
||||
GObject, if possible. Note that this change is known
|
||||
to break versions of the GTK+ Perl bindings older
|
||||
than GTK+ Perl 2.13.4. [Tim Janik]
|
||||
|
||||
* Add a setting to allow falling back to another icon
|
||||
theme before trying hicolor. [Rodney Dawes]
|
||||
|
||||
* Require GLib 2.8.5
|
||||
|
||||
* Updated translations (ca,el,es,fr,hi,it,ko,pt_BR,vi)
|
||||
|
||||
* Bugs fixed:
|
||||
137351 GtkEntryCompletion sometimes selects first completion item
|
||||
[Niklas Knutsson]
|
||||
165714 GtkEntryCompletion doesn't complete on paste [Christian Neumair]
|
||||
317687 gnome-panel crash by clicking on settings
|
||||
321548 speed up gtk_text_iter_set_visible_line_index [Paolo
|
||||
Borelli]
|
||||
323843 Garbage in gtk_text_view_get_border_window_size()
|
||||
323876 Broadcasting _GTK_LOAD_ICONTHEMES is a performance
|
||||
bug [Peter Lund]
|
||||
324044 Documentation entry for GtkTreeView::row-activated
|
||||
[Davyd Madeley]
|
||||
323504 Gtk-CRITICAL when dragging a launcher from the menu
|
||||
to the top panel [Kjartan Maraas]
|
||||
323655 Improved support for Icon Naming Spec in unix filesystem
|
||||
backend [Rodney Dawes]
|
||||
323995 hidden widgets distort the left/right/up/down focus
|
||||
order [Dan Winship]
|
||||
324588 icon_view auto dnd and the item-activated signal
|
||||
[Dave Andreoli]
|
||||
322475 icon view's horizontal layout doesn't respect
|
||||
item_width [Alex Graveley]
|
||||
324815 Typo in gtkwindow.c [Ross Burton]
|
||||
324996 Description about gtk_im_context_filter_keypress on API
|
||||
reference
|
||||
323666 gdk_window_scroll doesn't invalidate if another top-level
|
||||
is above window [John Ehresman]
|
||||
322264 gdk_drawable_get_visible_region win32 / x11 inconsistency
|
||||
[John Ehresman]
|
||||
325358 word erase in text fields considers space as a separate
|
||||
word [Akkana Peck]
|
||||
325443 gtk_drag_begin doesn't work unless given a motion event
|
||||
[Peter Harvey]
|
||||
325723 gtk_ui_manager_get_toplevels does not return an empty
|
||||
list [Steve Chaplin]
|
||||
305894 excessive memory use in gdk_pixbuf_new_from_file_XXX
|
||||
functions [Denis Vlasenko, Michael Natterer]
|
||||
325199 The API reference for gtk_exit() states that it's
|
||||
deprecated but doesn't state the replacement function,
|
||||
if any [Ævar Arnfjörð Bjarmason]
|
||||
325869 GtkViewPort not releasing signal handlers on destruction
|
||||
[Jorn Baayen]
|
||||
325782 GtkToolButton ::clicked signal should set G_SIGNAL_ACTION
|
||||
[Martyn Russell]
|
||||
325817 FileChooserButton uses "Home" instead of directory name
|
||||
[Federico Mena Quintero]
|
||||
326098 label alignment is wrong when width-chars is set [Benjamin Otte]
|
||||
326200 translations in GtkActionGroup erroneously translated
|
||||
[Christian Stimming]
|
||||
326429 in gtk.h, twice the same lines [Benoît Carpentier]
|
||||
326064 Artifacts on some widgets [Andrew Conkling]
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.8.8 to GTK+ 2.8.9
|
||||
=================================================
|
||||
* Bugs fixed:
|
||||
321560 File chooser filter behaves weird [Bogdan Nicula,
|
||||
Federico Mena Quintero]
|
||||
317999 2.8.4 to 2.8.6: sound-juicer crash, fileselector
|
||||
assertions [Sebastian Bacher]
|
||||
322569 On unsetting the Model, GtkTreeView does not clear
|
||||
it's associated TreeSelection [Milosz Derezynski]
|
||||
322998 Crash on selecting a file of null mime-type [Sadrul
|
||||
Habib Chowdhury]
|
||||
323024 gtktoolbutton leaks a pixbuf [Paolo Borelli]
|
||||
323209 GdkEvent leaked in gtktreeview.c /
|
||||
gtk_tree_view_key_press [Crispin Flowerday]
|
||||
323073 Typo in trap_activate_cb() [Sadrul Habib Chowdhury]
|
||||
323045 gtkcalendar.c: The identifier is already declared.
|
||||
[Kazuki Iwamoto]
|
||||
323386 gtk_menu_attach_to_widget() does not take NULL
|
||||
detacher [Jorn Baayen]
|
||||
307196 Unhinted fonts are measured incorrectly and drawing
|
||||
problems occur as a result [Alex Jones, Behdad Esfahbod]
|
||||
316310 unwanted scrolling in recent gtk [Paolo Borelli]
|
||||
322019 Toolbars without icons are invisible in icon-only
|
||||
mode [Ross Burton]
|
||||
323077 Search-entry in the TreeView not working properly
|
||||
[Sadrul Habib Chowdhury]
|
||||
323475 gtktoolbutton.c:562: warning: 'image' is used
|
||||
uninitialized in this function [Ross Burton]
|
||||
323577 reference count of textbuffer increases with each
|
||||
paste
|
||||
323629 gtk_selection_data_get_uris leaks memory
|
||||
[Markku Vire]
|
||||
|
||||
* Other changes
|
||||
- Remove GMemChunk from public header files to
|
||||
support building against GLib 2.10 [Matthias Clasen]
|
||||
- Report errors in option parsing [Matthias]
|
||||
- Merge upstream xdgmime changes to handle duplicate
|
||||
glob patterns [Matthias]
|
||||
|
||||
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.13. 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.
|
||||
|
||||
@@ -93,6 +93,11 @@ fi
|
||||
|
||||
rm -rf autom4te.cache
|
||||
|
||||
# README and INSTALL are required by automake, but may be deleted by clean
|
||||
# up rules. to get automake to work, simply touch these here, they will be
|
||||
# regenerated from their corresponding *.in files by ./configure anyway.
|
||||
touch README INSTALL
|
||||
|
||||
$ACLOCAL $ACLOCAL_FLAGS || exit $?
|
||||
|
||||
libtoolize --force || exit $?
|
||||
|
||||
+16
-11
@@ -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], [13])
|
||||
m4_define([gtk_version],
|
||||
[gtk_major_version.gtk_minor_version.gtk_micro_version])
|
||||
m4_define([gtk_interface_age], [2])
|
||||
m4_define([gtk_interface_age], [13])
|
||||
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
|
||||
@@ -31,7 +31,7 @@ m4_define([gtk_api_version], [2.0])
|
||||
m4_define([gtk_binary_version], [2.4.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.7.1])
|
||||
m4_define([glib_required_version], [2.8.5])
|
||||
m4_define([pango_required_version], [1.9.0])
|
||||
m4_define([atk_required_version], [1.0.1])
|
||||
m4_define([cairo_required_version], [0.9.2])
|
||||
@@ -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@Latn sr@ije sv ta te th tk tr uk uz uz@Latn vi wa xh yi zh_CN zh_HK zh_TW"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
|
||||
@@ -1045,10 +1045,10 @@ if test "x$gdktarget" = "xx11"; then
|
||||
#
|
||||
# Check for basic X packages; we use pkg-config if available
|
||||
#
|
||||
if $PKG_CONFIG --exists x11 xext; then
|
||||
if $PKG_CONFIG --exists x11 xext xrender; then
|
||||
have_base_x_pc=true
|
||||
X_PACKAGES="$X_PACKAGES x11 xext"
|
||||
x_libs="`pkg-config --libs x11 xext`"
|
||||
X_PACKAGES="$X_PACKAGES x11 xext xrender"
|
||||
x_libs="`pkg-config --libs x11 xext xrender`"
|
||||
|
||||
# Strip out any .la files that pkg-config might give us (this happens
|
||||
# with -uninstalled.pc files)
|
||||
@@ -1070,11 +1070,11 @@ if test "x$gdktarget" = "xx11"; then
|
||||
fi
|
||||
|
||||
x_cflags="$X_CFLAGS"
|
||||
x_libs_for_checks="$X_LIBS -lXext -lX11 $X_EXTRA_LIBS"
|
||||
x_libs_for_checks="$X_LIBS -lXext -lXrender -lX11 $X_EXTRA_LIBS"
|
||||
|
||||
GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
|
||||
GDK_PIXBUF_XLIB_EXTRA_LIBS="$X_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
GTK_DEP_LIBS_FOR_X="$X_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
GTK_DEP_LIBS_FOR_X="$X_LIBS -lX11 -lXrender $X_EXTRA_LIBS"
|
||||
fi
|
||||
|
||||
# Extra libraries found during checks (-lXinerama, etc), not from pkg-config.
|
||||
@@ -1093,6 +1093,8 @@ if test "x$gdktarget" = "xx11"; then
|
||||
AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]))
|
||||
AC_CHECK_FUNC(XextFindDisplay, :,
|
||||
AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]))
|
||||
AC_CHECK_FUNC(XRenderQueryExtension, :,
|
||||
AC_MSG_ERROR([*** libXrender not found. Check 'config.log' for more details.]))
|
||||
|
||||
# Check for xReply
|
||||
|
||||
@@ -1388,9 +1390,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,58 @@
|
||||
2006-02-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.13 ===
|
||||
|
||||
2006-02-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.12 ===
|
||||
|
||||
2006-01-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.11 ===
|
||||
|
||||
2006-01-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.10 ===
|
||||
|
||||
2005-12-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.9 ===
|
||||
|
||||
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
|
||||
|
||||
@@ -63,6 +63,7 @@ set_cell_color (GtkCellLayout *cell_layout,
|
||||
(color.red >> 8) << 24 |
|
||||
(color.green >> 8) << 16 |
|
||||
(color.blue >> 8) << 8;
|
||||
g_free (text);
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 24, 24);
|
||||
gdk_pixbuf_fill (pixbuf, pixel);
|
||||
|
||||
@@ -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,87 @@
|
||||
2006-02-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.13 ===
|
||||
|
||||
2006-02-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.12 ===
|
||||
|
||||
2006-02-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkliststore.sgml: Add a section about
|
||||
atomicity of insertions. (#329831, Milosz Derezynski)
|
||||
|
||||
2006-01-27 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gtk/tmpl/gtkfilechooser.sgml: Mention that ~ is also a default
|
||||
key binding.
|
||||
|
||||
2006-01-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.11 ===
|
||||
|
||||
2006-01-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.10 ===
|
||||
|
||||
2005-12-30 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkmain.sgml: Add deprecation note to
|
||||
gtk_exit() (#325199, Ævar Arnfjörð Bjarmason)
|
||||
|
||||
2005-12-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.9 ===
|
||||
|
||||
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>
|
||||
|
||||
@@ -19,6 +19,15 @@ and the entry will show the content of the text column in the selected row. To
|
||||
get the text from the entry, use gtk_combo_box_get_active_text().
|
||||
</para>
|
||||
|
||||
<para>The changed signal will be emitted while typing into a GtkComboBoxEntry,
|
||||
as well as when selecting an item from the GtkComboBoxEntry's list. Use
|
||||
gtk_combo_box_get_active() or gtk_combo_box_get_active_iter() to discover
|
||||
whether an item was actually selected from the list.
|
||||
</para>
|
||||
|
||||
<para>Connect to the activate signal of the GtkEntry (use gtk_bin_get_child()) to
|
||||
detect when the user actually finishes entering text.</para>
|
||||
|
||||
<para>
|
||||
The convenience API to construct simple text-only #GtkComboBox<!-- -->es can
|
||||
also be used with #GtkComboBoxEntry<!-- -->s which have been constructed
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -410,7 +410,9 @@ Indicates the direction a sub-menu will appear.
|
||||
<para>
|
||||
Used to customize the appearance of a #GtkToolbar. Note that
|
||||
setting the toolbar style overrides the user's preferences
|
||||
for the default toolbar style.
|
||||
for the default toolbar style. Note that if the button has only
|
||||
a label set and GTK_TOOLBAR_ICONS is used, the label will be
|
||||
visible, and vice versa.
|
||||
</para>
|
||||
|
||||
@GTK_TOOLBAR_ICONS: Buttons display only icons in the toolbar.
|
||||
|
||||
@@ -204,15 +204,33 @@ 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> (empty path);
|
||||
<keycap>/</keycap> (path of "/")<footnote>
|
||||
<para>
|
||||
Both the individual <keycap>/</keycap> key and the
|
||||
numeric keypad's "divide" key are supported.
|
||||
</para>
|
||||
</footnote>;
|
||||
<keycap>~</keycap> (path of "~")
|
||||
</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 +245,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 +260,7 @@ binding "my-own-gtkfilechooser-bindings" {
|
||||
"down-folder" ()
|
||||
}
|
||||
bind "<Alt><Shift>Home" {
|
||||
"home-folder-folder" ()
|
||||
"home-folder" ()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,14 +273,24 @@ 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. On Unix systems, this is bound to
|
||||
<keycap>~</keycap> (tilde) with a <parameter>path</parameter> string
|
||||
of "~" itself for access to home directories.
|
||||
</para>
|
||||
|
||||
<variablelist role="params">
|
||||
@@ -276,6 +302,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 +319,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 +356,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 +397,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 +432,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">
|
||||
|
||||
@@ -91,6 +91,19 @@ that #GtkTreeIter<!-- -->s can be cached while the row exists. Thus, if
|
||||
access to a particular row is needed often and your code is expected to
|
||||
run on older versions of GTK+, it is worth keeping the iter around.
|
||||
</para>
|
||||
<title>Atomic Operations</title>
|
||||
<para>
|
||||
It is important to note that only the methods @gtk_list_store_insert_with_values and
|
||||
@gtk_list_store_insert_with_valuesv are atomic, in the sense that the row is being appended
|
||||
to the store and the values filled in in a single operation with regard to #GtkTreeModel signaling.
|
||||
In contrast, using e.g. @gtk_list_store_append and then @gtk_list_store_set will first create a row,
|
||||
which triggers the "row_inserted" #GtkTreeModel signal on #GtkListStore. The row, however, is still
|
||||
empty, and any signal handler connecting to "row_inserted" on this particular store should be prepared
|
||||
for the situation that the row might be empty.
|
||||
This is especially important if you are wrapping the #GtkListStore inside a #GtkTreeModelFilter and are
|
||||
using a #GtkTreeModelFilterVisibleFunc. Using any of the non-atomic operations to append rows to the #GtkListStore
|
||||
will cause the #GtkTreeModelFilterVisibleFunc to be visited with an empty row first; the function must be prepared for that.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
|
||||
@@ -170,8 +170,8 @@ for GTK+.
|
||||
</para>
|
||||
|
||||
@error_code: Return value to pass to the caller. This is dependend on the
|
||||
target system but at least on Unix systems %0 means
|
||||
success.
|
||||
target system but at least on Unix systems %0 means success.
|
||||
@Deprecated: Use the standard exit() function instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_events_pending ##### -->
|
||||
|
||||
@@ -345,7 +345,7 @@ be invoked when the menu calls gtk_menu_detach() during its destruction.
|
||||
@menu: a #GtkMenu.
|
||||
@attach_widget: the #GtkWidget that the menu will be attached to.
|
||||
@detacher: the user supplied callback function that will be called when
|
||||
the menu calls gtk_menu_detach().
|
||||
the menu calls gtk_menu_detach(), or %NULL
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_detach ##### -->
|
||||
|
||||
@@ -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 ##### -->
|
||||
|
||||
@@ -83,6 +83,11 @@ Sharing settings between applications
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSettings:gtk-fallback-icon-theme ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkSettings:gtk-font-name ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -510,5 +510,6 @@ modified directly.
|
||||
</para>
|
||||
|
||||
@values:
|
||||
@Returns:
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,91 @@
|
||||
2006-02-24 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.13 ===
|
||||
|
||||
2006-02-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.12 ===
|
||||
|
||||
2006-02-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-jpeg.c:
|
||||
* io-png.c:
|
||||
* io-pnm.c:
|
||||
* io-tiff.c:
|
||||
* io-xbm.c:
|
||||
* io-xpm.c: Always check for NULL when using callbacks.
|
||||
(#330563, Benjamin Otte)
|
||||
|
||||
2006-01-25 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.11 ===
|
||||
|
||||
2006-01-12 Federico Mena Quintero <federico@ximian.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* gdk-pixbuf-util.c (gdk_pixbuf_saturate_and_pixelate): Clarify
|
||||
the docs ("darkened/brightened" is not "saturation").
|
||||
|
||||
2006-01-11 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.10 ===
|
||||
|
||||
2005-12-14 Michael Natterer <mitch@imendio.com>
|
||||
|
||||
Merged from HEAD:
|
||||
|
||||
* io-jpeg.c: applied patch from maemo-gtk which avoids the
|
||||
allocation of an intermediate buffer for non-progressive
|
||||
jpegs. Fixed bug #305894.
|
||||
|
||||
2005-12-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.8.9 ===
|
||||
|
||||
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\"" \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
|
||||
cpp -DINCLUDE_VARIABLES -P -DALL_FILES ${srcdir:-.}/gdk-pixbuf.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE$//' | sort > expected-abi
|
||||
nm -D .libs/libgdk_pixbuf-2.0.so | grep " [BDTR] " | cut -d ' ' -f 3 | sort > actual-abi
|
||||
nm -D -g --defined-only .libs/libgdk_pixbuf-2.0.so | cut -d ' ' -f 3 | sort > actual-abi
|
||||
diff -u expected-abi actual-abi && rm expected-abi actual-abi
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -159,14 +159,14 @@ gdk_pixbuf_copy_area (const GdkPixbuf *src_pixbuf,
|
||||
* @saturation: saturation factor
|
||||
* @pixelate: whether to pixelate
|
||||
*
|
||||
* Modifies saturation and optionally pixelates @src, placing the
|
||||
* result in @dest. @src and @dest may be the same pixbuf with no ill
|
||||
* effects. If @saturation is 1.0 then saturation is not changed. If
|
||||
* it's less than 1.0, saturation is reduced (the image is darkened);
|
||||
* if greater than 1.0, saturation is increased (the image is
|
||||
* brightened). If @pixelate is %TRUE, then pixels are faded in a
|
||||
* checkerboard pattern to create a pixelated image. @src and @dest
|
||||
* must have the same image format, size, and rowstride.
|
||||
* Modifies saturation and optionally pixelates @src, placing the result in
|
||||
* @dest. @src and @dest may be the same pixbuf with no ill effects. If
|
||||
* @saturation is 1.0 then saturation is not changed. If it's less than 1.0,
|
||||
* saturation is reduced (the image turns toward grayscale); if greater than
|
||||
* 1.0, saturation is increased (the image gets more vivid colors). If @pixelate
|
||||
* is %TRUE, then pixels are faded in a checkerboard pattern to create a
|
||||
* pixelated image. @src and @dest must have the same image format, size, and
|
||||
* rowstride.
|
||||
*
|
||||
**/
|
||||
void
|
||||
|
||||
+83
-54
@@ -546,6 +546,66 @@ gdk_pixbuf__jpeg_image_stop_load (gpointer data, GError **error)
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
gdk_pixbuf__jpeg_image_load_lines (JpegProgContext *context,
|
||||
GError **error)
|
||||
{
|
||||
struct jpeg_decompress_struct *cinfo = &context->cinfo;
|
||||
guchar *lines[4];
|
||||
guchar **lptr;
|
||||
guchar *rowptr;
|
||||
gint nlines, i;
|
||||
|
||||
/* keep going until we've done all scanlines */
|
||||
while (cinfo->output_scanline < cinfo->output_height) {
|
||||
lptr = lines;
|
||||
rowptr = context->dptr;
|
||||
for (i=0; i < cinfo->rec_outbuf_height; i++) {
|
||||
*lptr++ = rowptr;
|
||||
rowptr += context->pixbuf->rowstride;
|
||||
}
|
||||
|
||||
nlines = jpeg_read_scanlines (cinfo, lines,
|
||||
cinfo->rec_outbuf_height);
|
||||
if (nlines == 0)
|
||||
break;
|
||||
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
explode_gray_into_buf (cinfo, lines);
|
||||
break;
|
||||
case JCS_RGB:
|
||||
/* do nothing */
|
||||
break;
|
||||
case JCS_CMYK:
|
||||
convert_cmyk_to_rgb (cinfo, lines);
|
||||
break;
|
||||
default:
|
||||
if (error && *error == NULL) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Unsupported JPEG color space (%s)"),
|
||||
colorspace_name (cinfo->out_color_space));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
context->dptr += nlines * context->pixbuf->rowstride;
|
||||
|
||||
/* send updated signal */
|
||||
if (context->updated_func)
|
||||
(* context->updated_func) (context->pixbuf,
|
||||
0,
|
||||
cinfo->output_scanline - 1,
|
||||
cinfo->image_width,
|
||||
nlines,
|
||||
context->user_data);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -686,15 +746,16 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
context->dptr = context->pixbuf->pixels;
|
||||
|
||||
/* Notify the client that we are ready to go */
|
||||
(* context->prepared_func) (context->pixbuf,
|
||||
NULL,
|
||||
context->user_data);
|
||||
if (context->prepared_func)
|
||||
(* context->prepared_func) (context->pixbuf,
|
||||
NULL,
|
||||
context->user_data);
|
||||
|
||||
} else if (!context->did_prescan) {
|
||||
int rc;
|
||||
|
||||
/* start decompression */
|
||||
cinfo->buffered_image = TRUE;
|
||||
cinfo->buffered_image = cinfo->progressive_mode;
|
||||
rc = jpeg_start_decompress (cinfo);
|
||||
cinfo->do_fancy_upsampling = FALSE;
|
||||
cinfo->do_block_smoothing = FALSE;
|
||||
@@ -703,12 +764,20 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
continue;
|
||||
|
||||
context->did_prescan = TRUE;
|
||||
} else if (!cinfo->buffered_image) {
|
||||
/* we're decompressing unbuffered so
|
||||
* simply get scanline by scanline from jpeg lib
|
||||
*/
|
||||
if (! gdk_pixbuf__jpeg_image_load_lines (context,
|
||||
error))
|
||||
return FALSE;
|
||||
|
||||
if (cinfo->output_scanline >= cinfo->output_height)
|
||||
return TRUE;
|
||||
} else {
|
||||
/* we're decompressing so feed jpeg lib scanlines */
|
||||
guchar *lines[4];
|
||||
guchar **lptr;
|
||||
guchar *rowptr;
|
||||
gint nlines, i;
|
||||
/* we're decompressing buffered (progressive)
|
||||
* so feed jpeg lib scanlines
|
||||
*/
|
||||
|
||||
/* keep going until we've done all passes */
|
||||
while (!jpeg_input_complete (cinfo)) {
|
||||
@@ -720,53 +789,13 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
else
|
||||
break;
|
||||
}
|
||||
/* keep going until we've done all scanlines */
|
||||
while (cinfo->output_scanline < cinfo->output_height) {
|
||||
lptr = lines;
|
||||
rowptr = context->dptr;
|
||||
for (i=0; i < cinfo->rec_outbuf_height; i++) {
|
||||
*lptr++ = rowptr;
|
||||
rowptr += context->pixbuf->rowstride;
|
||||
}
|
||||
|
||||
nlines = jpeg_read_scanlines (cinfo, lines,
|
||||
cinfo->rec_outbuf_height);
|
||||
if (nlines == 0)
|
||||
break;
|
||||
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
explode_gray_into_buf (cinfo, lines);
|
||||
break;
|
||||
case JCS_RGB:
|
||||
/* do nothing */
|
||||
break;
|
||||
case JCS_CMYK:
|
||||
convert_cmyk_to_rgb (cinfo, lines);
|
||||
break;
|
||||
default:
|
||||
if (error && *error == NULL) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Unsupported JPEG color space (%s)"),
|
||||
colorspace_name (cinfo->out_color_space));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
/* get scanlines from jpeg lib */
|
||||
if (! gdk_pixbuf__jpeg_image_load_lines (context,
|
||||
error))
|
||||
return FALSE;
|
||||
|
||||
context->dptr += nlines * context->pixbuf->rowstride;
|
||||
|
||||
/* send updated signal */
|
||||
(* context->updated_func) (context->pixbuf,
|
||||
0,
|
||||
cinfo->output_scanline-1,
|
||||
cinfo->image_width,
|
||||
nlines,
|
||||
context->user_data);
|
||||
}
|
||||
if (cinfo->output_scanline >= cinfo->output_height &&
|
||||
if (cinfo->output_scanline >= cinfo->output_height &&
|
||||
jpeg_finish_output (cinfo))
|
||||
context->in_output = FALSE;
|
||||
else
|
||||
|
||||
+1
-1
@@ -517,7 +517,7 @@ gdk_pixbuf__png_image_load_increment(gpointer context,
|
||||
lc->error = NULL;
|
||||
return FALSE;
|
||||
} else {
|
||||
if (lc->first_row_seen_in_chunk >= 0) {
|
||||
if (lc->first_row_seen_in_chunk >= 0 && lc->update_func) {
|
||||
/* We saw at least one row */
|
||||
gint pass_diff = lc->last_pass_seen_in_chunk - lc->first_pass_seen_in_chunk;
|
||||
|
||||
|
||||
+5
-4
@@ -1015,9 +1015,10 @@ gdk_pixbuf__pnm_image_load_increment (gpointer data,
|
||||
context->rowstride = context->pixbuf->rowstride;
|
||||
|
||||
/* Notify the client that we are ready to go */
|
||||
(* context->prepared_func) (context->pixbuf,
|
||||
NULL,
|
||||
context->user_data);
|
||||
if (context->prepared_func)
|
||||
(* context->prepared_func) (context->pixbuf,
|
||||
NULL,
|
||||
context->user_data);
|
||||
}
|
||||
|
||||
/* if we got here we're reading image data */
|
||||
@@ -1028,7 +1029,7 @@ gdk_pixbuf__pnm_image_load_increment (gpointer data,
|
||||
break;
|
||||
} else if (retval == PNM_FATAL_ERR) {
|
||||
return FALSE;
|
||||
} else if (retval == PNM_OK) {
|
||||
} else if (retval == PNM_OK && context->updated_func) {
|
||||
/* send updated signal */
|
||||
(* context->updated_func) (context->pixbuf,
|
||||
0,
|
||||
|
||||
@@ -238,7 +238,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (context)
|
||||
if (context && context->prepare_func)
|
||||
(* context->prepare_func) (pixbuf, NULL, context->user_data);
|
||||
|
||||
#if TIFFLIB_VERSION >= 20031226
|
||||
@@ -324,7 +324,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
||||
_TIFFfree (rast);
|
||||
}
|
||||
|
||||
if (context)
|
||||
if (context && context->update_func)
|
||||
(* context->update_func) (pixbuf, 0, 0, width, height, context->user_data);
|
||||
|
||||
return pixbuf;
|
||||
|
||||
+3
-2
@@ -309,7 +309,7 @@ gdk_pixbuf__xbm_image_load_real (FILE *f, XBMData *context, GError **error)
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
row_stride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
|
||||
if (context)
|
||||
if (context && context->prepare_func)
|
||||
(* context->prepare_func) (pixbuf, NULL, context->user_data);
|
||||
|
||||
|
||||
@@ -338,7 +338,8 @@ gdk_pixbuf__xbm_image_load_real (FILE *f, XBMData *context, GError **error)
|
||||
g_free (data);
|
||||
|
||||
if (context) {
|
||||
(* context->update_func) (pixbuf, 0, 0, w, h, context->user_data);
|
||||
if (context->update_func)
|
||||
(* context->update_func) (pixbuf, 0, 0, w, h, context->user_data);
|
||||
g_object_unref (pixbuf);
|
||||
pixbuf = NULL;
|
||||
}
|
||||
|
||||
+11
-6
@@ -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,
|
||||
@@ -735,10 +738,12 @@ gdk_pixbuf__xpm_image_stop_load (gpointer data,
|
||||
pixbuf = gdk_pixbuf__xpm_image_load (context->file, error);
|
||||
|
||||
if (pixbuf != NULL) {
|
||||
(* context->prepare_func) (pixbuf,
|
||||
NULL,
|
||||
context->user_data);
|
||||
(* context->update_func) (pixbuf, 0, 0, pixbuf->width, pixbuf->height, context->user_data);
|
||||
if (context->prepare_func)
|
||||
(* context->prepare_func) (pixbuf,
|
||||
NULL,
|
||||
context->user_data);
|
||||
if (context->update_func)
|
||||
(* context->update_func) (pixbuf, 0, 0, pixbuf->width, pixbuf->height, context->user_data);
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
retval = TRUE;
|
||||
|
||||
+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
@@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
|
||||
cpp -DINCLUDE_VARIABLES -P -DALL_FILES -DGDK_ENABLE_BROKEN -DGDK_WINDOWING_X11 ${srcdir:-.}/gdk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' | sort | uniq > expected-abi
|
||||
nm -D .libs/libgdk-x11-2.0.so | grep " [BDTR] " | cut -d ' ' -f 3 | sort > actual-abi
|
||||
nm -D -g --defined-only .libs/libgdk-x11-2.0.so | cut -d ' ' -f 3 | sort > actual-abi
|
||||
diff -u expected-abi actual-abi && rm expected-abi actual-abi
|
||||
|
||||
@@ -200,6 +200,7 @@ gdk_parse_args (int *argc,
|
||||
{
|
||||
GOptionContext *option_context;
|
||||
GOptionGroup *option_group;
|
||||
GError *error = NULL;
|
||||
|
||||
if (gdk_initialized)
|
||||
return;
|
||||
@@ -215,7 +216,12 @@ gdk_parse_args (int *argc,
|
||||
g_option_group_add_entries (option_group, gdk_args);
|
||||
g_option_group_add_entries (option_group, _gdk_windowing_args);
|
||||
|
||||
g_option_context_parse (option_context, argc, argv, NULL);
|
||||
if (!g_option_context_parse (option_context, argc, argv, &error))
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
g_option_context_free (option_context);
|
||||
|
||||
GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
|
||||
guchar *end = p + 4 * width;
|
||||
guint t1,t2,t3;
|
||||
|
||||
#define MULT(d,c,a,t) G_STMT_START { t = c * a; d = ((t >> 8) + t) >> 8; } G_STMT_END
|
||||
#define MULT(d,c,a,t) G_STMT_START { t = c * a + 0x7f; d = ((t >> 8) + t) >> 8; } G_STMT_END
|
||||
|
||||
while (p < end)
|
||||
{
|
||||
|
||||
+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.
|
||||
**/
|
||||
|
||||
+2
-2
@@ -881,7 +881,7 @@ real_draw_glyphs (GdkDrawable *drawable,
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (drawable);
|
||||
_gdk_gc_update_context (gc, cr, NULL, NULL);
|
||||
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE);
|
||||
|
||||
if (matrix)
|
||||
{
|
||||
@@ -1005,7 +1005,7 @@ gdk_draw_trapezoids (GdkDrawable *drawable,
|
||||
g_return_if_fail (n_trapezoids == 0 || trapezoids != NULL);
|
||||
|
||||
cr = gdk_cairo_create (drawable);
|
||||
_gdk_gc_update_context (gc, cr, NULL, NULL);
|
||||
_gdk_gc_update_context (gc, cr, NULL, NULL, TRUE);
|
||||
|
||||
for (i = 0; i < n_trapezoids; i++)
|
||||
{
|
||||
|
||||
+13
-7
@@ -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);
|
||||
}
|
||||
@@ -1108,6 +1112,8 @@ gc_get_background (GdkGC *gc,
|
||||
* stipple from the GC. If this is present and the fill mode
|
||||
* of the GC isn't %GDK_STIPPLED or %GDK_OPAQUE_STIPPLED
|
||||
* the fill mode will be forced to %GDK_STIPPLED
|
||||
* @gc_changed: pass %FALSE if the @gc has not changed since the
|
||||
* last call to this function
|
||||
*
|
||||
* Set the attributes of a cairo context to match those of a #GdkGC
|
||||
* as far as possible. Some aspects of a #GdkGC, such as clip masks
|
||||
@@ -1117,7 +1123,8 @@ void
|
||||
_gdk_gc_update_context (GdkGC *gc,
|
||||
cairo_t *cr,
|
||||
GdkColor *override_foreground,
|
||||
GdkBitmap *override_stipple)
|
||||
GdkBitmap *override_stipple,
|
||||
gboolean gc_changed)
|
||||
{
|
||||
GdkGCPrivate *priv;
|
||||
GdkFill fill;
|
||||
@@ -1145,12 +1152,7 @@ _gdk_gc_update_context (GdkGC *gc,
|
||||
}
|
||||
|
||||
if (fill == GDK_OPAQUE_STIPPLED)
|
||||
{
|
||||
if (override_foreground)
|
||||
foreground = *override_foreground;
|
||||
else
|
||||
gc_get_background (gc, &background);
|
||||
}
|
||||
gc_get_background (gc, &background);
|
||||
|
||||
switch (fill)
|
||||
{
|
||||
@@ -1222,6 +1224,9 @@ _gdk_gc_update_context (GdkGC *gc,
|
||||
cairo_pattern_destroy (pattern);
|
||||
}
|
||||
|
||||
if (!gc_changed)
|
||||
return;
|
||||
|
||||
cairo_reset_clip (cr);
|
||||
if (priv->clip_region)
|
||||
{
|
||||
@@ -1239,5 +1244,6 @@ _gdk_gc_update_context (GdkGC *gc,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define __GDK_GC_C__
|
||||
#include "gdkaliasdef.c"
|
||||
|
||||
+2
-1
@@ -219,7 +219,8 @@ GdkGC *_gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
|
||||
void _gdk_gc_update_context (GdkGC *gc,
|
||||
cairo_t *cr,
|
||||
GdkColor *override_foreground,
|
||||
GdkBitmap *override_stipple);
|
||||
GdkBitmap *override_stipple,
|
||||
gboolean gc_changed);
|
||||
|
||||
/*************************************
|
||||
* Interfaces used by windowing code *
|
||||
|
||||
+53
-15
@@ -58,6 +58,8 @@ struct _GdkPangoRendererPrivate
|
||||
/* Current target */
|
||||
GdkDrawable *drawable;
|
||||
GdkGC *base_gc;
|
||||
|
||||
gboolean gc_changed;
|
||||
};
|
||||
|
||||
static PangoAttrType gdk_pango_attr_stipple_type;
|
||||
@@ -131,6 +133,21 @@ emboss_context (cairo_t *cr)
|
||||
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
color_equal (PangoColor *c1, PangoColor *c2)
|
||||
{
|
||||
if (!c1 && !c2)
|
||||
return TRUE;
|
||||
|
||||
if (c1 && c2 &&
|
||||
c1->red == c2->red &&
|
||||
c1->green == c2->green &&
|
||||
c1->blue == c2->blue)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static cairo_t *
|
||||
get_cairo_context (GdkPangoRenderer *gdk_renderer,
|
||||
PangoRenderPart part)
|
||||
@@ -156,28 +173,46 @@ get_cairo_context (GdkPangoRenderer *gdk_renderer,
|
||||
cairo_set_matrix (priv->cr, &cairo_matrix);
|
||||
}
|
||||
}
|
||||
|
||||
priv->last_part = (PangoRenderPart)-1;
|
||||
|
||||
if (part != priv->last_part)
|
||||
{
|
||||
PangoColor *pango_color = pango_renderer_get_color (renderer,
|
||||
part);
|
||||
GdkColor *color = NULL;
|
||||
PangoColor *pango_color;
|
||||
GdkColor *color;
|
||||
GdkColor tmp_color;
|
||||
if (pango_color)
|
||||
gboolean changed;
|
||||
|
||||
pango_color = pango_renderer_get_color (renderer, part);
|
||||
|
||||
if (priv->last_part != -1)
|
||||
changed = priv->gc_changed ||
|
||||
priv->stipple[priv->last_part] != priv->stipple[part] ||
|
||||
!color_equal (pango_color,
|
||||
pango_renderer_get_color (renderer, priv->last_part));
|
||||
else
|
||||
changed = TRUE;
|
||||
|
||||
if (changed)
|
||||
{
|
||||
tmp_color.red = pango_color->red;
|
||||
tmp_color.green = pango_color->green;
|
||||
tmp_color.blue = pango_color->blue;
|
||||
|
||||
color = &tmp_color;
|
||||
if (pango_color)
|
||||
{
|
||||
tmp_color.red = pango_color->red;
|
||||
tmp_color.green = pango_color->green;
|
||||
tmp_color.blue = pango_color->blue;
|
||||
|
||||
color = &tmp_color;
|
||||
}
|
||||
else
|
||||
color = NULL;
|
||||
|
||||
_gdk_gc_update_context (priv->base_gc,
|
||||
priv->cr,
|
||||
color,
|
||||
priv->stipple[part],
|
||||
priv->gc_changed);
|
||||
}
|
||||
|
||||
_gdk_gc_update_context (priv->base_gc,
|
||||
priv->cr,
|
||||
color,
|
||||
priv->stipple[part]);
|
||||
priv->last_part = part;
|
||||
priv->gc_changed = FALSE;
|
||||
}
|
||||
|
||||
return priv->cr;
|
||||
@@ -482,6 +517,7 @@ gdk_pango_renderer_init (GdkPangoRenderer *renderer)
|
||||
GdkPangoRendererPrivate);
|
||||
|
||||
renderer->priv->last_part = (PangoRenderPart)-1;
|
||||
renderer->priv->gc_changed = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -650,6 +686,8 @@ gdk_pango_renderer_set_gc (GdkPangoRenderer *gdk_renderer,
|
||||
priv->base_gc = gc;
|
||||
if (priv->base_gc)
|
||||
g_object_ref (priv->base_gc);
|
||||
|
||||
priv->gc_changed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ gdk_region_union_with_rect (GdkRegion *region,
|
||||
g_return_if_fail (region != NULL);
|
||||
g_return_if_fail (rect != NULL);
|
||||
|
||||
if (!rect->width || !rect->height)
|
||||
if (rect->width <= 0 || rect->height <= 0)
|
||||
return;
|
||||
|
||||
tmp_region.rects = &tmp_region.extents;
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
+101
-24
@@ -1725,43 +1725,86 @@ gdk_window_draw_glyphs_transformed (GdkDrawable *drawable,
|
||||
RESTORE_GC (gc);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
cairo_t *cr; /* if non-null, it means use this cairo context */
|
||||
GdkGC *gc; /* if non-null, it means use this GC instead */
|
||||
} BackingRectMethod;
|
||||
|
||||
static void
|
||||
gdk_window_set_bg_pattern (GdkWindow *window,
|
||||
cairo_t *cr,
|
||||
int x_offset,
|
||||
int y_offset)
|
||||
setup_backing_rect_method (BackingRectMethod *method, GdkWindow *window, GdkWindowPaint *paint, int x_offset_cairo, int y_offset_cairo)
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
|
||||
if (private->bg_pixmap == GDK_PARENT_RELATIVE_BG && private->parent)
|
||||
{
|
||||
x_offset += private->x;
|
||||
y_offset += private->y;
|
||||
gdk_window_set_bg_pattern (GDK_WINDOW (private->parent), cr,
|
||||
x_offset, y_offset);
|
||||
GdkWindowPaint tmp_paint;
|
||||
|
||||
tmp_paint = *paint;
|
||||
tmp_paint.x_offset += private->x;
|
||||
tmp_paint.y_offset += private->y;
|
||||
|
||||
x_offset_cairo += private->x;
|
||||
y_offset_cairo += private->y;
|
||||
|
||||
setup_backing_rect_method (method, GDK_WINDOW (private->parent), &tmp_paint, x_offset_cairo, y_offset_cairo);
|
||||
}
|
||||
else if (private->bg_pixmap &&
|
||||
private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
|
||||
private->bg_pixmap != GDK_NO_BG)
|
||||
else if (private->bg_pixmap &&
|
||||
private->bg_pixmap != GDK_PARENT_RELATIVE_BG &&
|
||||
private->bg_pixmap != GDK_NO_BG)
|
||||
{
|
||||
/* This is a workaround for https://bugs.freedesktop.org/show_bug.cgi?id=4320.
|
||||
* In it, using a pixmap as a repeating pattern in Cairo, and painting it to a
|
||||
* pixmap destination surface, can be very slow (on the order of seconds for a
|
||||
* whole-screen copy). The workaround is to use pretty much the same code that
|
||||
* we used in GTK+ 2.6 (pre-Cairo), which clears the double-buffer pixmap with
|
||||
* a tiled GC XFillRectangle().
|
||||
*/
|
||||
|
||||
/* Actually computing this flag is left as an exercise for the reader */
|
||||
#if defined (G_OS_UNIX)
|
||||
# define GDK_CAIRO_REPEAT_IS_FAST 0
|
||||
#else
|
||||
# define GDK_CAIRO_REPEAT_IS_FAST 1
|
||||
#endif
|
||||
|
||||
#if GDK_CAIRO_REPEAT_IS_FAST
|
||||
cairo_surface_t *surface = _gdk_drawable_ref_cairo_surface (private->bg_pixmap);
|
||||
cairo_pattern_t *pattern = cairo_pattern_create_for_surface (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
if (x_offset != 0 || y_offset != 0)
|
||||
if (x_offset_cairo != 0 || y_offset_cairo != 0)
|
||||
{
|
||||
cairo_matrix_t matrix;
|
||||
cairo_matrix_init_translate (&matrix, x_offset, y_offset);
|
||||
cairo_matrix_init_translate (&matrix, x_offset_cairo, y_offset_cairo);
|
||||
cairo_pattern_set_matrix (pattern, &matrix);
|
||||
}
|
||||
|
||||
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
|
||||
cairo_set_source (cr, pattern);
|
||||
|
||||
method->cr = cairo_create (paint->surface);
|
||||
method->gc = NULL;
|
||||
|
||||
cairo_set_source (method->cr, pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
#else
|
||||
guint gc_mask;
|
||||
GdkGCValues gc_values;
|
||||
|
||||
gc_values.fill = GDK_TILED;
|
||||
gc_values.tile = private->bg_pixmap;
|
||||
gc_values.ts_x_origin = -x_offset_cairo;
|
||||
gc_values.ts_y_origin = -y_offset_cairo;
|
||||
|
||||
gc_mask = GDK_GC_FILL | GDK_GC_TILE | GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN;
|
||||
|
||||
method->gc = gdk_gc_new_with_values (paint->pixmap, &gc_values, gc_mask);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_cairo_set_source_color (cr, &private->bg_color);
|
||||
method->cr = cairo_create (paint->surface);
|
||||
|
||||
gdk_cairo_set_source_color (method->cr, &private->bg_color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1774,22 +1817,56 @@ gdk_window_clear_backing_rect (GdkWindow *window,
|
||||
{
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkWindowPaint *paint = private->paint_stack->data;
|
||||
cairo_t *cr;
|
||||
BackingRectMethod method;
|
||||
#if 0
|
||||
GTimer *timer;
|
||||
double elapsed;
|
||||
#endif
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
cr = cairo_create (paint->surface);
|
||||
#if 0
|
||||
timer = g_timer_new ();
|
||||
#endif
|
||||
|
||||
gdk_window_set_bg_pattern (window, cr, 0, 0);
|
||||
method.cr = NULL;
|
||||
method.gc = NULL;
|
||||
setup_backing_rect_method (&method, window, paint, 0, 0);
|
||||
|
||||
cairo_rectangle (cr, x, y, width, height);
|
||||
cairo_clip (cr);
|
||||
if (method.cr)
|
||||
{
|
||||
g_assert (method.gc == NULL);
|
||||
|
||||
gdk_cairo_region (cr, paint->region);
|
||||
cairo_fill (cr);
|
||||
cairo_rectangle (method.cr, x, y, width, height);
|
||||
cairo_clip (method.cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
gdk_cairo_region (method.cr, paint->region);
|
||||
cairo_fill (method.cr);
|
||||
|
||||
cairo_destroy (method.cr);
|
||||
#if 0
|
||||
elapsed = g_timer_elapsed (timer, NULL);
|
||||
g_print ("Draw the background with Cairo: %fs\n", elapsed);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
g_assert (method.gc != NULL);
|
||||
|
||||
gdk_gc_set_clip_region (method.gc, paint->region);
|
||||
gdk_draw_rectangle (window, method.gc, TRUE, x, y, width, height);
|
||||
g_object_unref (method.gc);
|
||||
|
||||
#if 0
|
||||
elapsed = g_timer_elapsed (timer, NULL);
|
||||
g_print ("Draw the background with GDK: %fs\n", elapsed);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
g_timer_destroy (timer);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2450,7 +2527,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)
|
||||
|
||||
+40
-21
@@ -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;
|
||||
|
||||
@@ -584,7 +585,7 @@ gdk_pointer_grab (GdkWindow *window,
|
||||
if (p_grab_window != NULL && p_grab_window != window)
|
||||
generate_grab_broken_event (p_grab_window, FALSE, window);
|
||||
|
||||
p_grab_window = window;
|
||||
assign_object (&p_grab_window, window);
|
||||
|
||||
if (p_grab_cursor != NULL)
|
||||
{
|
||||
@@ -641,7 +642,7 @@ gdk_display_pointer_ungrab (GdkDisplay *display,
|
||||
|
||||
/* FIXME: Generate GDK_CROSSING_UNGRAB events */
|
||||
|
||||
p_grab_window = NULL;
|
||||
assign_object (&p_grab_window, NULL);
|
||||
if (p_grab_cursor != NULL)
|
||||
{
|
||||
if (GetCursor () == p_grab_cursor)
|
||||
@@ -758,7 +759,7 @@ gdk_keyboard_grab (GdkWindow *window,
|
||||
if (k_grab_window != NULL && k_grab_window != window)
|
||||
generate_grab_broken_event (k_grab_window, TRUE, window);
|
||||
|
||||
k_grab_window = window;
|
||||
assign_object (&k_grab_window, window);
|
||||
|
||||
if (!k_grab_owner_events)
|
||||
{
|
||||
@@ -823,7 +824,7 @@ gdk_display_keyboard_ungrab (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
k_grab_window = NULL;
|
||||
assign_object (&k_grab_window, NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -1972,7 +1973,7 @@ erase_background (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
static GdkRegion *
|
||||
GdkRegion *
|
||||
_gdk_win32_hrgn_to_region (HRGN hrgn)
|
||||
{
|
||||
RGNDATA *rgndata;
|
||||
@@ -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)
|
||||
@@ -2738,7 +2749,22 @@ gdk_event_translate (MSG *msg,
|
||||
GdkWindow *real_window = find_real_window_for_grabbed_mouse_event (window, msg);
|
||||
|
||||
if (real_window != current_window)
|
||||
synthesize_crossing_events (real_window, GDK_CROSSING_NORMAL, msg);
|
||||
{
|
||||
if (p_grab_owner_events)
|
||||
{
|
||||
synthesize_crossing_events (real_window, GDK_CROSSING_NORMAL, msg);
|
||||
}
|
||||
else if (current_window == p_grab_window)
|
||||
{
|
||||
synthesize_leave_event (p_grab_window, msg, GDK_CROSSING_NORMAL, GDK_NOTIFY_ANCESTOR);
|
||||
assign_object (¤t_window, _gdk_root);
|
||||
}
|
||||
else if (real_window == p_grab_window)
|
||||
{
|
||||
synthesize_enter_event (p_grab_window, msg, GDK_CROSSING_NORMAL, GDK_NOTIFY_ANCESTOR);
|
||||
assign_object (¤t_window, p_grab_window);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2757,15 +2783,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 +2791,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;
|
||||
@@ -2815,6 +2832,7 @@ gdk_event_translate (MSG *msg,
|
||||
synthesize_enter_or_leave_event (current_window, msg,
|
||||
GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL, detail,
|
||||
current_x, current_y);
|
||||
assign_object (¤t_window, _gdk_root);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2904,7 +2922,8 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
|
||||
case WM_MOUSEACTIVATE:
|
||||
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP)
|
||||
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP
|
||||
|| !((GdkWindowObject *)window)->accept_focus)
|
||||
{
|
||||
*ret_valp = MA_NOACTIVATE;
|
||||
return_val = TRUE;
|
||||
|
||||
@@ -108,9 +108,9 @@ gdk_window_scroll (GdkWindow *window,
|
||||
GdkRegion *invalidate_region;
|
||||
GdkWindowImplWin32 *impl;
|
||||
GdkWindowObject *obj;
|
||||
GdkRectangle dest_rect;
|
||||
GList *tmp_list;
|
||||
GdkWindowParentPos parent_pos;
|
||||
HRGN native_invalidate_region;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -130,22 +130,6 @@ gdk_window_scroll (GdkWindow *window,
|
||||
if (obj->update_area)
|
||||
gdk_region_offset (obj->update_area, dx, dy);
|
||||
|
||||
invalidate_region = gdk_region_rectangle (&impl->position_info.clip_rect);
|
||||
|
||||
dest_rect = impl->position_info.clip_rect;
|
||||
dest_rect.x += dx;
|
||||
dest_rect.y += dy;
|
||||
gdk_rectangle_intersect (&dest_rect, &impl->position_info.clip_rect, &dest_rect);
|
||||
|
||||
if (dest_rect.width > 0 && dest_rect.height > 0)
|
||||
{
|
||||
GdkRegion *tmp_region;
|
||||
|
||||
tmp_region = gdk_region_rectangle (&dest_rect);
|
||||
gdk_region_subtract (invalidate_region, tmp_region);
|
||||
gdk_region_destroy (tmp_region);
|
||||
}
|
||||
|
||||
gdk_window_compute_parent_pos (impl, &parent_pos);
|
||||
|
||||
parent_pos.x += obj->x;
|
||||
@@ -156,10 +140,13 @@ gdk_window_scroll (GdkWindow *window,
|
||||
|
||||
gdk_window_tmp_unset_bg (window);
|
||||
|
||||
if (!ScrollWindowEx (GDK_WINDOW_HWND (window),
|
||||
dx, dy, NULL, NULL,
|
||||
NULL, NULL, SW_SCROLLCHILDREN))
|
||||
WIN32_API_FAILED ("ScrollWindowEx");
|
||||
native_invalidate_region = CreateRectRgn (0, 0, 0, 0);
|
||||
if (native_invalidate_region == NULL)
|
||||
WIN32_API_FAILED ("CreateRectRgn");
|
||||
|
||||
API_CALL (ScrollWindowEx, (GDK_WINDOW_HWND (window),
|
||||
dx, dy, NULL, NULL,
|
||||
native_invalidate_region, NULL, SW_SCROLLCHILDREN));
|
||||
|
||||
if (impl->position_info.no_bg)
|
||||
gdk_window_tmp_reset_bg (window);
|
||||
@@ -173,8 +160,15 @@ gdk_window_scroll (GdkWindow *window,
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
gdk_window_invalidate_region (window, invalidate_region, TRUE);
|
||||
gdk_region_destroy (invalidate_region);
|
||||
if (native_invalidate_region != NULL)
|
||||
{
|
||||
invalidate_region = _gdk_win32_hrgn_to_region (native_invalidate_region);
|
||||
gdk_region_offset (invalidate_region, impl->position_info.x_offset,
|
||||
impl->position_info.y_offset);
|
||||
gdk_window_invalidate_region (window, invalidate_region, TRUE);
|
||||
gdk_region_destroy (invalidate_region);
|
||||
GDI_CALL (DeleteObject, (native_invalidate_region));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -353,12 +353,11 @@ HRGN _gdk_win32_gdkregion_to_hrgn (GdkRegion *region,
|
||||
gint x_origin,
|
||||
gint y_origin);
|
||||
|
||||
GdkRegion *_gdk_win32_hrgn_to_region (HRGN hrgn);
|
||||
|
||||
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 +471,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 +489,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;
|
||||
|
||||
+395
-336
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);
|
||||
|
||||
@@ -430,8 +430,12 @@ update_cursor (gpointer key,
|
||||
gpointer value,
|
||||
gpointer data)
|
||||
{
|
||||
XID *xid = key;
|
||||
GdkCursor *cursor;
|
||||
|
||||
if (*xid & XID_FONT_BIT)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (value))
|
||||
return;
|
||||
|
||||
@@ -446,7 +450,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 +486,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++;
|
||||
|
||||
+10
-3
@@ -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 },
|
||||
@@ -3035,8 +3035,14 @@ _gdk_drag_get_protocol_for_display (GdkDisplay *display,
|
||||
GDK_NOTE (DND, g_message ("Entering local Xdnd window %#x\n", xid));
|
||||
return xid;
|
||||
}
|
||||
else
|
||||
return None;
|
||||
else if (_gdk_x11_display_is_root_window (display, (Window) xid))
|
||||
{
|
||||
*protocol = GDK_DRAG_PROTO_ROOTWIN;
|
||||
GDK_NOTE (DND, g_message ("Entering root window\n"));
|
||||
return xid;
|
||||
}
|
||||
|
||||
return None;
|
||||
}
|
||||
|
||||
if ((retval = xdnd_check_dest (display, xid, version)))
|
||||
@@ -3104,6 +3110,7 @@ _gdk_drag_get_protocol_for_display (GdkDisplay *display,
|
||||
if (rootwin)
|
||||
{
|
||||
*protocol = GDK_DRAG_PROTO_ROOTWIN;
|
||||
GDK_NOTE (DND, g_message ("Entering root window\n"));
|
||||
return xid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2807,6 +2807,7 @@ static const struct
|
||||
{ "Xft/HintStyle", "gtk-xft-hintstyle" },
|
||||
{ "Xft/RGBA", "gtk-xft-rgba" },
|
||||
{ "Xft/DPI", "gtk-xft-dpi" },
|
||||
{ "Net/FallbackIconTheme", "gtk-fallback-icon-theme" }
|
||||
};
|
||||
|
||||
static void
|
||||
|
||||
@@ -50,6 +50,7 @@ struct _GdkFontPrivateX
|
||||
GdkDisplay *display;
|
||||
|
||||
GSList *names;
|
||||
XID xid;
|
||||
};
|
||||
|
||||
static GHashTable *
|
||||
@@ -214,13 +215,14 @@ gdk_font_load_for_display (GdkDisplay *display,
|
||||
private->xfont = xfont;
|
||||
private->base.ref_count = 1;
|
||||
private->names = NULL;
|
||||
private->xid = xfont->fid | XID_FONT_BIT;
|
||||
|
||||
font = (GdkFont*) private;
|
||||
font->type = GDK_FONT_FONT;
|
||||
font->ascent = xfont->ascent;
|
||||
font->descent = xfont->descent;
|
||||
|
||||
_gdk_xid_table_insert (display, &xfont->fid, font);
|
||||
_gdk_xid_table_insert (display, &private->xid, font);
|
||||
}
|
||||
|
||||
gdk_font_hash_insert (GDK_FONT_FONT, font, font_name);
|
||||
|
||||
+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 */
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ struct _GdkVisualPrivate
|
||||
GdkScreen *screen;
|
||||
};
|
||||
|
||||
#define XID_FONT_BIT (1<<31)
|
||||
|
||||
void _gdk_xid_table_insert (GdkDisplay *display,
|
||||
XID *xid,
|
||||
gpointer data);
|
||||
|
||||
@@ -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)
|
||||
|
||||
+30
-6
@@ -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)
|
||||
@@ -5541,6 +5565,7 @@ finish_drag (MoveResizeData *mv_resize)
|
||||
{
|
||||
gdk_window_destroy (mv_resize->moveresize_emulation_window);
|
||||
mv_resize->moveresize_emulation_window = NULL;
|
||||
g_object_unref (mv_resize->moveresize_window);
|
||||
mv_resize->moveresize_window = NULL;
|
||||
|
||||
if (mv_resize->moveresize_pending_event)
|
||||
@@ -5720,8 +5745,7 @@ create_moveresize_window (MoveResizeData *mv_resize,
|
||||
/* If this fails, some other client has grabbed the window
|
||||
* already.
|
||||
*/
|
||||
gdk_window_destroy (mv_resize->moveresize_emulation_window);
|
||||
mv_resize->moveresize_emulation_window = NULL;
|
||||
finish_drag (mv_resize);
|
||||
}
|
||||
|
||||
mv_resize->moveresize_process_time = 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))
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ static gboolean
|
||||
gdk_xid_equal (XID *a,
|
||||
XID *b)
|
||||
{
|
||||
return (*a == *b);
|
||||
return ((*a & ~XID_FONT_BIT) == (*b & ~XID_FONT_BIT));
|
||||
}
|
||||
|
||||
#define __GDK_XID_C__
|
||||
|
||||
+7
-9
@@ -2,22 +2,19 @@
|
||||
|
||||
# Build zipfiles for GTK on Win32
|
||||
|
||||
ZIP=/tmp/gtk+-@GTK_VERSION@-`date +%Y%m%d`.zip
|
||||
DEVZIP=/tmp/gtk+-dev-@GTK_VERSION@-`date +%Y%m%d`.zip
|
||||
ZIP=/tmp/gtk+-@GTK_VERSION@.zip
|
||||
DEVZIP=/tmp/gtk+-dev-@GTK_VERSION@.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
|
||||
@@ -27,7 +24,8 @@ zip $ZIP share/themes/Default/gtk-2.0-key/gtkrc
|
||||
zip $ZIP share/themes/Emacs/gtk-2.0-key/gtkrc
|
||||
zip $ZIP share/themes/MS-Windows/gtk-2.0/gtkrc
|
||||
|
||||
zip -r $ZIP lib/locale/*/LC_MESSAGES/gtk20.mo
|
||||
zip $ZIP lib/locale/*/LC_MESSAGES/gtk20.mo
|
||||
zip $ZIP lib/locale/*/LC_MESSAGES/gtk20-properties.mo
|
||||
|
||||
rm $DEVZIP
|
||||
zip -r $DEVZIP -@ <<EOF
|
||||
|
||||
+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@\" */" \
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
|
||||
cpp -DINCLUDE_VARIABLES -P -DG_OS_UNIX -DGTK_WINDOWING_X11 -DALL_FILES ${srcdir:-.}/gtk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' | sort > expected-abi
|
||||
nm -D .libs/libgtk-x11-2.0.so | grep " [BDTR] " | cut -d ' ' -f 3 | sort > actual-abi
|
||||
nm -D -g --defined-only .libs/libgtk-x11-2.0.so | cut -d ' ' -f 3 | sort > actual-abi
|
||||
diff -u expected-abi actual-abi && rm expected-abi actual-abi
|
||||
|
||||
@@ -162,7 +162,6 @@
|
||||
#include <gtk/gtktogglebutton.h>
|
||||
#include <gtk/gtktoggletoolbutton.h>
|
||||
#include <gtk/gtktoolbar.h>
|
||||
#include <gtk/gtktoolbar.h>
|
||||
#include <gtk/gtktoolbutton.h>
|
||||
#include <gtk/gtktoolitem.h>
|
||||
#include <gtk/gtktooltips.h>
|
||||
|
||||
+10
-8
@@ -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);
|
||||
@@ -502,11 +502,13 @@ gtk_about_dialog_init (GtkAboutDialog *about)
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
/* Add the OK button */
|
||||
gtk_dialog_add_button (GTK_DIALOG (about), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (about), GTK_RESPONSE_CLOSE);
|
||||
gtk_dialog_add_button (GTK_DIALOG (about), GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (about), GTK_RESPONSE_CANCEL);
|
||||
|
||||
/* 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);
|
||||
@@ -2031,13 +2033,13 @@ display_credits_dialog (GtkWidget *button,
|
||||
dialog = gtk_dialog_new_with_buttons (_("Credits"),
|
||||
GTK_WINDOW (about),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL,
|
||||
NULL);
|
||||
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
|
||||
|
||||
priv->credits_dialog = dialog;
|
||||
gtk_window_set_default_size (GTK_WINDOW (dialog), 360, 260);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog),
|
||||
gtk_window_get_modal (GTK_WINDOW (about)));
|
||||
@@ -2103,12 +2105,12 @@ display_license_dialog (GtkWidget *button,
|
||||
dialog = gtk_dialog_new_with_buttons (_("License"),
|
||||
GTK_WINDOW (about),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL,
|
||||
NULL);
|
||||
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
|
||||
priv->license_dialog = dialog;
|
||||
gtk_window_set_default_size (GTK_WINDOW (dialog), 420, 320);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog),
|
||||
gtk_window_get_modal (GTK_WINDOW (about)));
|
||||
|
||||
+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)
|
||||
|
||||
+30
-14
@@ -417,7 +417,8 @@ gtk_action_group_get_sensitive (GtkActionGroup *action_group)
|
||||
}
|
||||
|
||||
static void
|
||||
cb_set_action_sensitivity (const gchar *name, GtkAction *action)
|
||||
cb_set_action_sensitivity (const gchar *name,
|
||||
GtkAction *action)
|
||||
{
|
||||
/* Minor optimization, the action_groups state only affects actions that are
|
||||
* themselves sensitive */
|
||||
@@ -435,15 +436,20 @@ cb_set_action_sensitivity (const gchar *name, GtkAction *action)
|
||||
* Since: 2.4
|
||||
*/
|
||||
void
|
||||
gtk_action_group_set_sensitive (GtkActionGroup *action_group, gboolean sensitive)
|
||||
gtk_action_group_set_sensitive (GtkActionGroup *action_group,
|
||||
gboolean sensitive)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
|
||||
|
||||
if (action_group->private_data->sensitive ^ sensitive)
|
||||
sensitive = sensitive != FALSE;
|
||||
|
||||
if (action_group->private_data->sensitive != sensitive)
|
||||
{
|
||||
action_group->private_data->sensitive = sensitive;
|
||||
g_hash_table_foreach (action_group->private_data->actions,
|
||||
(GHFunc) cb_set_action_sensitivity, NULL);
|
||||
|
||||
g_object_notify (G_OBJECT (action_group), "sensitive");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +475,8 @@ gtk_action_group_get_visible (GtkActionGroup *action_group)
|
||||
}
|
||||
|
||||
static void
|
||||
cb_set_action_visiblity (const gchar *name, GtkAction *action)
|
||||
cb_set_action_visiblity (const gchar *name,
|
||||
GtkAction *action)
|
||||
{
|
||||
/* Minor optimization, the action_groups state only affects actions that are
|
||||
* themselves sensitive */
|
||||
@@ -487,15 +494,20 @@ cb_set_action_visiblity (const gchar *name, GtkAction *action)
|
||||
* Since: 2.4
|
||||
*/
|
||||
void
|
||||
gtk_action_group_set_visible (GtkActionGroup *action_group, gboolean visible)
|
||||
gtk_action_group_set_visible (GtkActionGroup *action_group,
|
||||
gboolean visible)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
|
||||
|
||||
if (action_group->private_data->visible ^ visible)
|
||||
visible = visible != FALSE;
|
||||
|
||||
if (action_group->private_data->visible != visible)
|
||||
{
|
||||
action_group->private_data->visible = visible;
|
||||
g_hash_table_foreach (action_group->private_data->actions,
|
||||
(GHFunc) cb_set_action_visiblity, NULL);
|
||||
|
||||
g_object_notify (G_OBJECT (action_group), "visible");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -569,8 +581,8 @@ gtk_action_group_add_action (GtkActionGroup *action_group,
|
||||
*/
|
||||
void
|
||||
gtk_action_group_add_action_with_accel (GtkActionGroup *action_group,
|
||||
GtkAction *action,
|
||||
const gchar *accelerator)
|
||||
GtkAction *action,
|
||||
const gchar *accelerator)
|
||||
{
|
||||
gchar *accel_path;
|
||||
guint accel_key = 0;
|
||||
@@ -1006,10 +1018,10 @@ gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group
|
||||
* Since: 2.4
|
||||
**/
|
||||
void
|
||||
gtk_action_group_set_translate_func (GtkActionGroup *action_group,
|
||||
GtkTranslateFunc func,
|
||||
gpointer data,
|
||||
GtkDestroyNotify notify)
|
||||
gtk_action_group_set_translate_func (GtkActionGroup *action_group,
|
||||
GtkTranslateFunc func,
|
||||
gpointer data,
|
||||
GtkDestroyNotify notify)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
|
||||
|
||||
@@ -1025,7 +1037,11 @@ static gchar *
|
||||
dgettext_swapped (const gchar *msgid,
|
||||
const gchar *domainname)
|
||||
{
|
||||
return dgettext (domainname, msgid);
|
||||
/* Pass through dgettext if and only if msgid is nonempty. */
|
||||
if (msgid && *msgid)
|
||||
return dgettext (domainname, msgid);
|
||||
else
|
||||
return (gchar*) msgid;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1116,7 +1132,7 @@ _gtk_action_group_emit_pre_activate (GtkActionGroup *action_group,
|
||||
|
||||
void
|
||||
_gtk_action_group_emit_post_activate (GtkActionGroup *action_group,
|
||||
GtkAction *action)
|
||||
GtkAction *action)
|
||||
{
|
||||
g_signal_emit (action_group, action_group_signals[POST_ACTIVATE], 0, 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);
|
||||
|
||||
|
||||
+119
-56
@@ -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
|
||||
@@ -56,46 +63,39 @@
|
||||
#include "gtkalias.h"
|
||||
|
||||
/***************************************************************************/
|
||||
/* The following date routines are taken from the lib_date package. Keep
|
||||
* them separate in case we want to update them if a newer lib_date comes
|
||||
* out with fixes. */
|
||||
/* The following date routines are taken from the lib_date package.
|
||||
* They have been minimally edited to avoid conflict with types defined
|
||||
* in win32 headers.
|
||||
*/
|
||||
|
||||
typedef unsigned int N_int;
|
||||
typedef unsigned long N_long;
|
||||
typedef signed long Z_long;
|
||||
typedef enum { false = FALSE , true = TRUE } boolean;
|
||||
|
||||
#define and && /* logical (boolean) operators: lower case */
|
||||
#define or ||
|
||||
|
||||
static const N_int month_length[2][13] =
|
||||
static const guint month_length[2][13] =
|
||||
{
|
||||
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
|
||||
{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
|
||||
};
|
||||
|
||||
static const N_int days_in_months[2][14] =
|
||||
static const guint days_in_months[2][14] =
|
||||
{
|
||||
{ 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
|
||||
{ 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
|
||||
};
|
||||
|
||||
static Z_long calc_days(N_int year, N_int mm, N_int dd);
|
||||
static N_int day_of_week(N_int year, N_int mm, N_int dd);
|
||||
static Z_long dates_difference(N_int year1, N_int mm1, N_int dd1,
|
||||
N_int year2, N_int mm2, N_int dd2);
|
||||
static N_int weeks_in_year(N_int year);
|
||||
static glong calc_days(guint year, guint mm, guint dd);
|
||||
static guint day_of_week(guint year, guint mm, guint dd);
|
||||
static glong dates_difference(guint year1, guint mm1, guint dd1,
|
||||
guint year2, guint mm2, guint dd2);
|
||||
static guint weeks_in_year(guint year);
|
||||
|
||||
static boolean
|
||||
leap(N_int year)
|
||||
static gboolean
|
||||
leap (guint year)
|
||||
{
|
||||
return((((year % 4) == 0) and ((year % 100) != 0)) or ((year % 400) == 0));
|
||||
return((((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0));
|
||||
}
|
||||
|
||||
static N_int
|
||||
day_of_week(N_int year, N_int mm, N_int dd)
|
||||
static guint
|
||||
day_of_week (guint year, guint mm, guint dd)
|
||||
{
|
||||
Z_long days;
|
||||
glong days;
|
||||
|
||||
days = calc_days(year, mm, dd);
|
||||
if (days > 0L)
|
||||
@@ -104,53 +104,53 @@ day_of_week(N_int year, N_int mm, N_int dd)
|
||||
days %= 7L;
|
||||
days++;
|
||||
}
|
||||
return( (N_int) days );
|
||||
return( (guint) days );
|
||||
}
|
||||
|
||||
static N_int weeks_in_year(N_int year)
|
||||
static guint weeks_in_year(guint year)
|
||||
{
|
||||
return(52 + ((day_of_week(year,1,1)==4) or (day_of_week(year,12,31)==4)));
|
||||
return(52 + ((day_of_week(year,1,1)==4) || (day_of_week(year,12,31)==4)));
|
||||
}
|
||||
|
||||
static boolean
|
||||
check_date(N_int year, N_int mm, N_int dd)
|
||||
static gboolean
|
||||
check_date(guint year, guint mm, guint dd)
|
||||
{
|
||||
if (year < 1) return(false);
|
||||
if ((mm < 1) or (mm > 12)) return(false);
|
||||
if ((dd < 1) or (dd > month_length[leap(year)][mm])) return(false);
|
||||
return(true);
|
||||
if (year < 1) return FALSE;
|
||||
if ((mm < 1) || (mm > 12)) return FALSE;
|
||||
if ((dd < 1) || (dd > month_length[leap(year)][mm])) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static N_int
|
||||
week_number(N_int year, N_int mm, N_int dd)
|
||||
static guint
|
||||
week_number(guint year, guint mm, guint dd)
|
||||
{
|
||||
N_int first;
|
||||
guint first;
|
||||
|
||||
first = day_of_week(year,1,1) - 1;
|
||||
return( (N_int) ( (dates_difference(year,1,1, year,mm,dd) + first) / 7L ) +
|
||||
return( (guint) ( (dates_difference(year,1,1, year,mm,dd) + first) / 7L ) +
|
||||
(first < 4) );
|
||||
}
|
||||
|
||||
static Z_long
|
||||
year_to_days(N_int year)
|
||||
static glong
|
||||
year_to_days(guint year)
|
||||
{
|
||||
return( year * 365L + (year / 4) - (year / 100) + (year / 400) );
|
||||
}
|
||||
|
||||
|
||||
static Z_long
|
||||
calc_days(N_int year, N_int mm, N_int dd)
|
||||
static glong
|
||||
calc_days(guint year, guint mm, guint dd)
|
||||
{
|
||||
boolean lp;
|
||||
gboolean lp;
|
||||
|
||||
if (year < 1) return(0L);
|
||||
if ((mm < 1) or (mm > 12)) return(0L);
|
||||
if ((dd < 1) or (dd > month_length[(lp = leap(year))][mm])) return(0L);
|
||||
if ((mm < 1) || (mm > 12)) return(0L);
|
||||
if ((dd < 1) || (dd > month_length[(lp = leap(year))][mm])) return(0L);
|
||||
return( year_to_days(--year) + days_in_months[lp][mm] + dd );
|
||||
}
|
||||
|
||||
static boolean
|
||||
week_of_year(N_int *week, N_int *year, N_int mm, N_int dd)
|
||||
static gboolean
|
||||
week_of_year(guint *week, guint *year, guint mm, guint dd)
|
||||
{
|
||||
if (check_date(*year,mm,dd))
|
||||
{
|
||||
@@ -162,14 +162,14 @@ week_of_year(N_int *week, N_int *year, N_int mm, N_int dd)
|
||||
*week = 1;
|
||||
(*year)++;
|
||||
}
|
||||
return(true);
|
||||
return TRUE;
|
||||
}
|
||||
return(false);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static Z_long
|
||||
dates_difference(N_int year1, N_int mm1, N_int dd1,
|
||||
N_int year2, N_int mm2, N_int dd2)
|
||||
static glong
|
||||
dates_difference(guint year1, guint mm1, guint dd1,
|
||||
guint year2, guint mm2, guint dd2)
|
||||
{
|
||||
return( calc_days(year2, mm2, dd2) - calc_days(year1, mm1, dd1) );
|
||||
}
|
||||
@@ -562,11 +562,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 +587,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 +646,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 +700,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 +730,8 @@ gtk_calendar_init (GtkCalendar *calendar)
|
||||
priv->week_start = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
calendar_compute_days (calendar);
|
||||
}
|
||||
|
||||
|
||||
@@ -2846,6 +2907,8 @@ gtk_calendar_focus_out (GtkWidget *widget,
|
||||
{
|
||||
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
|
||||
calendar_stop_spinning (GTK_CALENDAR (widget));
|
||||
|
||||
priv->in_drag = 0;
|
||||
|
||||
+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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+6
-6
@@ -4439,8 +4439,8 @@ gtk_clist_finalize (GObject *object)
|
||||
|
||||
columns_delete (clist);
|
||||
|
||||
g_mem_chunk_destroy (clist->cell_mem_chunk);
|
||||
g_mem_chunk_destroy (clist->row_mem_chunk);
|
||||
g_mem_chunk_destroy ((GMemChunk *)clist->cell_mem_chunk);
|
||||
g_mem_chunk_destroy ((GMemChunk *)clist->row_mem_chunk);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
@@ -6375,8 +6375,8 @@ row_new (GtkCList *clist)
|
||||
int i;
|
||||
GtkCListRow *clist_row;
|
||||
|
||||
clist_row = g_chunk_new (GtkCListRow, clist->row_mem_chunk);
|
||||
clist_row->cell = g_chunk_new (GtkCell, clist->cell_mem_chunk);
|
||||
clist_row = g_chunk_new (GtkCListRow, (GMemChunk *)clist->row_mem_chunk);
|
||||
clist_row->cell = g_chunk_new (GtkCell, (GMemChunk *)clist->cell_mem_chunk);
|
||||
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
{
|
||||
@@ -6425,8 +6425,8 @@ row_delete (GtkCList *clist,
|
||||
if (clist_row->destroy)
|
||||
clist_row->destroy (clist_row->data);
|
||||
|
||||
g_mem_chunk_free (clist->cell_mem_chunk, clist_row->cell);
|
||||
g_mem_chunk_free (clist->row_mem_chunk, clist_row);
|
||||
g_mem_chunk_free ((GMemChunk *)clist->cell_mem_chunk, clist_row->cell);
|
||||
g_mem_chunk_free ((GMemChunk *)clist->row_mem_chunk, clist_row);
|
||||
}
|
||||
|
||||
/* FOCUS FUNCTIONS
|
||||
|
||||
+2
-2
@@ -152,8 +152,8 @@ struct _GtkCList
|
||||
guint16 flags;
|
||||
|
||||
/* mem chunks */
|
||||
GMemChunk *row_mem_chunk;
|
||||
GMemChunk *cell_mem_chunk;
|
||||
gpointer row_mem_chunk;
|
||||
gpointer cell_mem_chunk;
|
||||
|
||||
guint freeze_count;
|
||||
|
||||
|
||||
+17
-2
@@ -103,6 +103,7 @@ static void gtk_color_button_get_property (GObject *object,
|
||||
|
||||
/* gtkwidget signals */
|
||||
static void gtk_color_button_realize (GtkWidget *widget);
|
||||
static void gtk_color_button_unrealize (GtkWidget *widget);
|
||||
static void gtk_color_button_state_changed (GtkWidget *widget,
|
||||
GtkStateType previous_state);
|
||||
static void gtk_color_button_style_set (GtkWidget *widget,
|
||||
@@ -186,6 +187,7 @@ gtk_color_button_class_init (GtkColorButtonClass *klass)
|
||||
gobject_class->finalize = gtk_color_button_finalize;
|
||||
widget_class->state_changed = gtk_color_button_state_changed;
|
||||
widget_class->realize = gtk_color_button_realize;
|
||||
widget_class->unrealize = gtk_color_button_unrealize;
|
||||
widget_class->style_set = gtk_color_button_style_set;
|
||||
button_class->clicked = gtk_color_button_clicked;
|
||||
klass->color_set = NULL;
|
||||
@@ -408,12 +410,23 @@ gtk_color_button_realize (GtkWidget *widget)
|
||||
|
||||
GTK_WIDGET_CLASS (parent_class)->realize (widget);
|
||||
|
||||
if (color_button->priv->gc == NULL)
|
||||
color_button->priv->gc = gdk_gc_new (widget->window);
|
||||
color_button->priv->gc = gdk_gc_new (widget->window);
|
||||
|
||||
render (color_button);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_color_button_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkColorButton *color_button = GTK_COLOR_BUTTON (widget);
|
||||
|
||||
g_object_unref (color_button->priv->gc);
|
||||
color_button->priv->gc = NULL;
|
||||
|
||||
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_button_style_set (GtkWidget *widget,
|
||||
GtkStyle *previous_style)
|
||||
@@ -567,6 +580,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);
|
||||
|
||||
+11
-7
@@ -525,10 +525,12 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
|
||||
* GtkComboBox::changed:
|
||||
* @widget: the object which received the signal
|
||||
*
|
||||
* The changed signal gets emitted when the active
|
||||
* The changed signal is emitted when the active
|
||||
* item is changed. The can be due to the user selecting
|
||||
* a different item from the list, or due to a
|
||||
* call to gtk_combo_box_set_active_iter().
|
||||
* It will also be emitted while typing into a GtkComboBoxEntry,
|
||||
* as well as when selecting an item from the GtkComboBoxEntry's list.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
@@ -736,6 +738,8 @@ gtk_combo_box_init (GtkComboBox *combo_box)
|
||||
combo_box->priv->editing_canceled = FALSE;
|
||||
combo_box->priv->auto_scroll = FALSE;
|
||||
combo_box->priv->focus_on_click = TRUE;
|
||||
|
||||
gtk_combo_box_check_appearance (combo_box);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1777,9 +1781,7 @@ gtk_combo_box_size_request (GtkWidget *widget,
|
||||
GtkRequisition bin_req;
|
||||
|
||||
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
|
||||
|
||||
gtk_combo_box_check_appearance (combo_box);
|
||||
|
||||
|
||||
/* common */
|
||||
gtk_widget_size_request (GTK_BIN (widget)->child, &bin_req);
|
||||
gtk_combo_box_remeasure (combo_box);
|
||||
@@ -1872,8 +1874,6 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
|
||||
GtkRequisition req;
|
||||
gboolean is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
|
||||
|
||||
gtk_combo_box_check_appearance (combo_box);
|
||||
|
||||
widget->allocation = *allocation;
|
||||
|
||||
gtk_widget_style_get (GTK_WIDGET (widget),
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
+15
-12
@@ -1710,10 +1710,8 @@ up_down_compare (gconstpointer a,
|
||||
CompareInfo *compare = data;
|
||||
gint y1, y2;
|
||||
|
||||
if (!get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1))
|
||||
return 0;
|
||||
if (!get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2))
|
||||
return 0;
|
||||
get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1);
|
||||
get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2);
|
||||
|
||||
y1 = allocation1.y + allocation1.height / 2;
|
||||
y2 = allocation2.y + allocation2.height / 2;
|
||||
@@ -1839,10 +1837,8 @@ left_right_compare (gconstpointer a,
|
||||
CompareInfo *compare = data;
|
||||
gint x1, x2;
|
||||
|
||||
if (!get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1))
|
||||
return 0;
|
||||
if (!get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2))
|
||||
return 0;
|
||||
get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1);
|
||||
get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2);
|
||||
|
||||
x1 = allocation1.x + allocation1.width / 2;
|
||||
x2 = allocation2.x + allocation2.width / 2;
|
||||
@@ -1983,19 +1979,26 @@ _gtk_container_focus_sort (GtkContainer *container,
|
||||
GtkDirectionType direction,
|
||||
GtkWidget *old_focus)
|
||||
{
|
||||
children = g_list_copy (children);
|
||||
GList *visible_children = NULL;
|
||||
|
||||
while (children)
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (children->data))
|
||||
visible_children = g_list_prepend (visible_children, children->data);
|
||||
children = children->next;
|
||||
}
|
||||
|
||||
switch (direction)
|
||||
{
|
||||
case GTK_DIR_TAB_FORWARD:
|
||||
case GTK_DIR_TAB_BACKWARD:
|
||||
return gtk_container_focus_sort_tab (container, children, direction, old_focus);
|
||||
return gtk_container_focus_sort_tab (container, visible_children, direction, old_focus);
|
||||
case GTK_DIR_UP:
|
||||
case GTK_DIR_DOWN:
|
||||
return gtk_container_focus_sort_up_down (container, children, direction, old_focus);
|
||||
return gtk_container_focus_sort_up_down (container, visible_children, direction, old_focus);
|
||||
case GTK_DIR_LEFT:
|
||||
case GTK_DIR_RIGHT:
|
||||
return gtk_container_focus_sort_left_right (container, children, direction, old_focus);
|
||||
return gtk_container_focus_sort_left_right (container, visible_children, direction, old_focus);
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user