Compare commits
447 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c0c91c50f3 | |||
| 67929eac9c | |||
| 017ec26350 | |||
| 2985dd58ad | |||
| 96c9280372 | |||
| bc9bb250c1 | |||
| 95a8e44796 | |||
| 2f522f2b8c | |||
| e3758bf6ca | |||
| 15edfbfd7a | |||
| 543cfe8335 | |||
| fc6e1b1d5f | |||
| 1e71906f51 | |||
| b098b27234 | |||
| 8ab27fbb9c | |||
| 12f3dd40f0 | |||
| d920b23642 | |||
| 49cdfb697f | |||
| 81510c9f17 | |||
| dd96b0da26 | |||
| 6f59f4764a | |||
| 4dce1ced1c | |||
| 0d07382511 | |||
| 6f8e727617 | |||
| a47f916553 | |||
| 273e09a0c8 | |||
| fd46b9d477 | |||
| 596bf1c6ad | |||
| 49dee1b663 | |||
| d17cb8ac8a | |||
| 9977fc50d7 | |||
| a01b78860c | |||
| b1a004c1ba | |||
| 569f3321a5 | |||
| 527ea27a19 | |||
| 19d32714e9 | |||
| d61669e6d3 | |||
| 3083a903d1 | |||
| 1db39506ab | |||
| 779091175d | |||
| 2146148b46 | |||
| 5981275a1f | |||
| b626e5d50e | |||
| 48251ab74e | |||
| 0220067376 | |||
| 5f5b54ebbe | |||
| f5b219d5ba | |||
| e767d7e37d | |||
| 2e8594e553 | |||
| 7b2b2987c2 | |||
| e2a76050f9 | |||
| 31a5de9c85 | |||
| 4094234b65 | |||
| 3e53866811 | |||
| 5a2a96f3f8 | |||
| 89679badf3 | |||
| aaaa0915d7 | |||
| fe66c311dd | |||
| 08f278c830 | |||
| d493b42c87 | |||
| f52c485e71 | |||
| 15d28319ff | |||
| 65188481a2 | |||
| 7a89ee2b31 | |||
| d33b360c93 | |||
| 370c5d7bd8 | |||
| 56a0748b9e | |||
| 322e7369a9 | |||
| 5a3761d885 | |||
| 5ad73998fd | |||
| 4cd0ea5a14 | |||
| ff03c02f25 | |||
| 8125ad9bf0 | |||
| 936d877657 | |||
| f833f22e42 | |||
| d5b82b8c09 | |||
| d7beeb09bc | |||
| 65bfb383ff | |||
| c1afab7ace | |||
| 40d7aff8cf | |||
| f683bffca0 | |||
| b8ab05b497 | |||
| 933181a5ba | |||
| 3f11289039 | |||
| 8bced4a6e2 | |||
| 2c1c27920f | |||
| fee27db187 | |||
| b6b8f84530 | |||
| e2fa935e17 | |||
| 75c550f662 | |||
| 15d107a2f1 | |||
| 27d8a1f312 | |||
| dbb99cb02e | |||
| 4960c3c504 | |||
| cd0c47f00a | |||
| fb090c5816 | |||
| 3611328d76 | |||
| 3e6b263ae7 | |||
| a70f23c605 | |||
| 09c2e41429 | |||
| 1ed1d38dbd | |||
| 8db4d1ee79 | |||
| 94b7dfbb13 | |||
| 98f234e73a | |||
| d88a3d3f7f | |||
| d554f8b4ff | |||
| 1b07b921b3 | |||
| 3ed0663ea0 | |||
| a5c7f5c708 | |||
| 699973f3c2 | |||
| f2288088c5 | |||
| 441c4ad480 | |||
| b698461f2d | |||
| bb1e1c5601 | |||
| 07b2fd4cd5 | |||
| 588158cefa | |||
| 0f72cd6f8d | |||
| 2f5d836635 | |||
| 3b3bf93279 | |||
| 85dc52fcec | |||
| 36d1dfff9b | |||
| dda04e8b56 | |||
| f9995755b7 | |||
| 9a677f24ac | |||
| d947b6b5dc | |||
| a797222ec2 | |||
| 31bd06846b | |||
| 038e15813a | |||
| 24333b6835 | |||
| 25f6b3d71e | |||
| 94f3e4c6a2 | |||
| d84ecfebe0 | |||
| d15e6d1564 | |||
| db3e94e7e5 | |||
| c2b0b603a8 | |||
| b0cd81b0be | |||
| b03345022a | |||
| 03d6aa295c | |||
| cec947fed4 | |||
| 83feff9fb9 | |||
| 2897be9c73 | |||
| 5e941b85e2 | |||
| 1e5a8ff4b1 | |||
| 6c5da8ef45 | |||
| c7fb1425a5 | |||
| 303ad1b982 | |||
| e28b96327d | |||
| 2570c46f89 | |||
| 12a70a1c88 | |||
| 11bcc14b56 | |||
| 36491a2d6b | |||
| ce627a575e | |||
| d9cf92fe9d | |||
| bf3cce478c | |||
| 4f1acaaee6 | |||
| 53e2422ee2 | |||
| ab22e08d0f | |||
| f141c611fa | |||
| d148bc6164 | |||
| 3eee4bb63d | |||
| 4107a925ce | |||
| f045a8df05 | |||
| 1901be48e7 | |||
| efd485faad | |||
| b7a7f4fb87 | |||
| eedd9aca54 | |||
| f45b12831b | |||
| a3a986f376 | |||
| a9a93701fe | |||
| fc13cd5ca3 | |||
| 112933a0a8 | |||
| 7c6054c8f6 | |||
| 1441b7ac88 | |||
| 8978c69794 | |||
| aff352be5a | |||
| da3eaddf31 | |||
| bfaa163449 | |||
| 7689a9cd75 | |||
| f4f85430d6 | |||
| 33133a94a6 | |||
| 938a8ff8bc | |||
| 614c41482e | |||
| 55b0c99e50 | |||
| 1ea77f98ae | |||
| 1b3d68b259 | |||
| e6e9857d5d | |||
| 635ae20cd8 | |||
| a74dfbde33 | |||
| 2941a61e2e | |||
| c0073fe550 | |||
| a008f1b30d | |||
| 80a96aca60 | |||
| 17336bc839 | |||
| 1397596de7 | |||
| 48f6bb1a78 | |||
| e855e03e46 | |||
| 84536cf68e | |||
| fc438198f0 | |||
| 6381413650 | |||
| be7d2921da | |||
| 155f81666f | |||
| 02030f4f26 | |||
| 41f1c60ee9 | |||
| 269804ecbf | |||
| d9be014869 | |||
| 63e0207772 | |||
| 2eaef04711 | |||
| ae7c8f7f6f | |||
| d107e53764 | |||
| c8bbc34461 | |||
| af6fbfc5f1 | |||
| 46a24bfce6 | |||
| 5da0096ce7 | |||
| ebb2e413fb | |||
| 8dd94a9008 | |||
| 80140dcbb2 | |||
| 619ba1523d | |||
| c7583f3773 | |||
| baa373e64a | |||
| ecebf9ed1d | |||
| f8816994fc | |||
| bc0c483119 | |||
| f1d8efe4a0 | |||
| 415bfe39e4 | |||
| bd12de15d5 | |||
| 309b86b222 | |||
| 0f7b37bfe1 | |||
| d936efe384 | |||
| 5157187347 | |||
| 080557e033 | |||
| f6e00fcc3b | |||
| 8dab597810 | |||
| 1f30863ca5 | |||
| aadae9561d | |||
| d1cbce98da | |||
| b839f8c614 | |||
| 3bac9cc8a1 | |||
| f61bbb2c16 | |||
| 92723128db | |||
| 140f28ef7d | |||
| ececb56172 | |||
| b16a02e4d3 | |||
| d32b4c4b31 | |||
| d21c62afe6 | |||
| a6d56c1581 | |||
| 7bcdd85f44 | |||
| 9acfc51107 | |||
| 3fdeec6bed | |||
| b822a3f120 | |||
| 82feefe954 | |||
| 56acf81297 | |||
| cc79b4cb19 | |||
| 1fa00a87fc | |||
| a4efc109cc | |||
| 3351655750 | |||
| 7a8337feb4 | |||
| 93a3cc51eb | |||
| 876f6600ec | |||
| 4ab6bf34f9 | |||
| d9c88a51a1 | |||
| 145acc18d2 | |||
| 582fd1376b | |||
| 339b8ca807 | |||
| 1ec2ccb1b0 | |||
| 613e88b80b | |||
| 852f235f1e | |||
| 004651e579 | |||
| e425a25b74 | |||
| 468b7f8aa3 | |||
| c04a3608e5 | |||
| 08b8313896 | |||
| 03255fa874 | |||
| 9dfc48823f | |||
| 6837e6ca22 | |||
| 3d2d989079 | |||
| 6fb50c934c | |||
| ec021e2f7e | |||
| 5c8107296f | |||
| 2601eff280 | |||
| 15c471f7b8 | |||
| e7a79f9009 | |||
| 315842bc0a | |||
| 9f55833bd6 | |||
| a622849f8e | |||
| 1255866280 | |||
| 98e34328dc | |||
| 9cae0ee065 | |||
| 885f9d272b | |||
| 13911b5e62 | |||
| 04d270b317 | |||
| 0a52ff76c4 | |||
| c89efae603 | |||
| 01b03a6c0e | |||
| b705df8d77 | |||
| b3bcb11867 | |||
| e97aecaf01 | |||
| e06b15eca5 | |||
| 8ef8a36c71 | |||
| 84b8295d35 | |||
| bb217039a2 | |||
| bdbf92bd55 | |||
| fc02ca7c8d | |||
| 32f58034a8 | |||
| fac16294ac | |||
| aa84805eb3 | |||
| ef31de52c6 | |||
| fbb07bf75a | |||
| 0ae179e974 | |||
| 4cc03789a6 | |||
| 28f05f2aaa | |||
| 2f3adcac97 | |||
| a21cbfc272 | |||
| 2caa0a86ef | |||
| 8bb6729e21 | |||
| 011a75e87a | |||
| 6a43975787 | |||
| 71586016d5 | |||
| ffdd1deed6 | |||
| 43f4ac3029 | |||
| 17af886caa | |||
| de2bebed70 | |||
| aedbca9c4f | |||
| f009c071be | |||
| 9bd1afdbf5 | |||
| 28a934ec50 | |||
| 3b72b601e9 | |||
| 2cc7978998 | |||
| e19fe1750f | |||
| 1b4619a1ab | |||
| 04de2d6d9e | |||
| 88f4a4fb15 | |||
| 26cafb1ecc | |||
| 3353b00d41 | |||
| 18a60d65f0 | |||
| ad218f70c3 | |||
| ad09810cda | |||
| 09a6b649f8 | |||
| 4152cd0cc9 | |||
| dd5f8231d7 | |||
| 26078768ee | |||
| b352f2acf0 | |||
| 156c9836ac | |||
| 4d31da4bcb | |||
| 31fa0a3957 | |||
| d811b99ef0 | |||
| dd673b1f62 | |||
| 12845f1238 | |||
| 0e2a177730 | |||
| f9d78657c9 | |||
| dc4d1e7b32 | |||
| 6aad7e6ca2 | |||
| 1d56123af5 | |||
| f68def9b26 | |||
| e55bb28ea3 | |||
| f46e13b2ca | |||
| 0345180108 | |||
| cc7b318d33 | |||
| a53b4f690c | |||
| ff1a375f1c | |||
| 788911254d | |||
| 2d3b39f09e | |||
| 91591f61d0 | |||
| 1d63787d59 | |||
| c1928d9215 | |||
| 5d99b24899 | |||
| 44ba0ec85a | |||
| f8ce259ffd | |||
| 1817e87aaf | |||
| 04c303be84 | |||
| 3391a567ba | |||
| 32937cbc50 | |||
| 73dd6eced9 | |||
| 930f8598b3 | |||
| 147542f4c9 | |||
| ef090e9bd1 | |||
| fe41c67383 | |||
| d2f20c569b | |||
| 681d09c445 | |||
| 90df66719e | |||
| 688bcfb9af | |||
| caf185f203 | |||
| cc7e25a8c5 | |||
| 7a7b67d9af | |||
| c098ad9322 | |||
| e990e263ee | |||
| 13714d2bf9 | |||
| 26bfe50bda | |||
| 74bc175ff8 | |||
| eda5bfe265 | |||
| 8a41c27cf0 | |||
| 555fe02158 | |||
| 421e584e60 | |||
| 1527fc1dc5 | |||
| 322dea23ec | |||
| 9c9a94d7d1 | |||
| ea100431e6 | |||
| 4f80d8cad3 | |||
| a7f987efde | |||
| 38f0b9edb7 | |||
| 10a9738f66 | |||
| 0df9c38c7c | |||
| 761534e891 | |||
| d75204ce72 | |||
| 109aa20ac8 | |||
| 1b0b68823f | |||
| 2967e14fd2 | |||
| 4b944e5ceb | |||
| 359f67ff92 | |||
| f24bc05f6f | |||
| ac65b919f6 | |||
| 5af07304e6 | |||
| 9cbebf285b | |||
| bc9f7d7d8b | |||
| c29a297737 | |||
| 9fde410c97 | |||
| 5e439f2306 | |||
| 6a6b25c93b | |||
| 4c1bab5db8 | |||
| 4e99673620 | |||
| 00caaf8b51 | |||
| 0e9c362952 | |||
| 7ec6657e4a | |||
| 21e70a8aee | |||
| 69d039dfb0 | |||
| 0ce517a221 | |||
| c209b1c750 | |||
| 0937798f0e | |||
| e9a0d2a444 | |||
| 3dcb893b4b | |||
| b78cefa20b | |||
| 37e471289f | |||
| 13c588303f | |||
| 10df3fe5ea | |||
| 26a6bcd73b | |||
| 310b25767c | |||
| 61ae384fcc | |||
| 9c262a1e27 | |||
| 7d02f89099 | |||
| 66c3f0984b | |||
| d393a037d9 | |||
| c005046c17 | |||
| 9c6e62a231 | |||
| 42c6c0516f | |||
| d6279caadd | |||
| 6a13e3d82b | |||
| 7306716d4a | |||
| 1818a9cb06 |
@@ -4,7 +4,7 @@ Prerequisites
|
||||
GTK+ requires the following packages:
|
||||
|
||||
- The GLib, Pango, ATK and cairo libraries, available at the same
|
||||
location as GTK+. GTK+ 2.12.1 requires at least GLib 2.12,
|
||||
location as GTK+. GTK+ 2.12.12 requires at least GLib 2.12,
|
||||
Pango 1.13, ATK 1.9 and cairo 1.2.
|
||||
|
||||
- The TIFF, PNG, and JPEG image loading libraries. You most
|
||||
@@ -20,8 +20,8 @@ GTK+ requires the following packages:
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-2.12.1.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.12.1 # change to the toplevel directory
|
||||
% gzip -cd gtk+-2.12.12.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.12.12 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK+
|
||||
[ Become root if necessary ]
|
||||
|
||||
@@ -1,3 +1,375 @@
|
||||
Overview of Changes from GTK+ 2.12.11 to 2.12.12
|
||||
================================================
|
||||
|
||||
* Bugs fixed:
|
||||
539164 Windows' System Menu blocks main loop
|
||||
540861 invalid UTF-8 in input device name
|
||||
540994 Some windows don't appear at the top when created
|
||||
541964 Setting modal hint to current value might confuse the stack
|
||||
541399 Widget tooltips: treat "" same as NULL
|
||||
520165 typeahead find (interactive search) only accepts one character
|
||||
528975 Can not maximize the window
|
||||
541950 Removing recently-added accelerator UI causes a wrong g_warning
|
||||
545931 small documentation typos
|
||||
538686 gtkprintoperation-win32.c: devmode_from_settings
|
||||
538863 Fixes assertion on entering empty folder
|
||||
541645 gtkfilechooserdefault segfaults when bookmark does not contain ://
|
||||
528845 segv from GtkBuilder on attempting <accelerator> under GtkCellView
|
||||
479780 Bookmarks in left pane of FileChooser cannot be renamed
|
||||
542523 GtkTextTag should handle setting properties to NULL
|
||||
543545 GtkAssistant crashes when gtk_widget_hide() is called inside...
|
||||
545875 evo crashed when trying to print pages 6-7 of a 1 page email
|
||||
549354 Crash trying to open a file on a remote folder
|
||||
549810 Memory leaks in printing code
|
||||
550528 IconView DND interface does not work if only used as source
|
||||
319849 gtkcalendar look in RTL locales
|
||||
551699 gtk_scrolled_window_destroy() is broken
|
||||
551567 DND mark broken
|
||||
551378 Print dialog: should try UDS when fetching PPD for localhost
|
||||
532644 TIFF loader need to exclude CR2 files
|
||||
549711 Race condition when loading gdk-pixbuf image modules
|
||||
517233 Calling gdk_pixbuf_loader_close causes "GError set over the top...
|
||||
|
||||
* Updated translations:
|
||||
Assamese (as)
|
||||
Czech (cs)
|
||||
Spanish (es)
|
||||
Italian (it)
|
||||
Japanese (ja)
|
||||
Russian (ru)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.10 to 2.12.11
|
||||
================================================
|
||||
|
||||
* Bugs fixed:
|
||||
536757 regression: openoffice.org menus are placed at wrong
|
||||
position since 2.12.10
|
||||
536990 updateiconcache.c: 'close ()' is redundant
|
||||
508751 gnome-terminal crashed with SIGSEGV after keypress
|
||||
419737 The file chooser clears the filename entry in SAVE/CREATE_FOLDER
|
||||
modes when it shouldn't.
|
||||
538784 Don't change the filename in the name entry in CREATE_FOLDER mode
|
||||
when changing folders
|
||||
536966 Paper selector crashes
|
||||
352738 gtk_tree_view_column_set_sort_indicator() fails to show a...
|
||||
378158 gdk_win32_selection_add_targets uses uninitialized hwnd v...
|
||||
537685 print to file crashes when the target can not be written
|
||||
|
||||
* Updated translations:
|
||||
Assamese (as)
|
||||
Catalan (ca)
|
||||
French (fr)
|
||||
Hungarian (hu)
|
||||
Brazilian Portugese (pt_BR)
|
||||
Swedish (sv)
|
||||
Vietnamese (vi)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.9 to 2.12.10
|
||||
===============================================
|
||||
|
||||
* Bugs fixed:
|
||||
523782 Leftover call to GDK_THREADS_LEAVE() in gtktoolbar.c
|
||||
524151 Dragging of 0-byte files results in an empty filename...
|
||||
524422 assertion when filechooser current name set to string...
|
||||
492134 The file chooser incorrectly substitutes and expands...
|
||||
330743 Up/down spinbuttons won't take zeros and exhibit very...
|
||||
529386 Printing options hidden by blacklisted option
|
||||
532059 Leak in win32 clipboard manipulation
|
||||
532558 Cannot build dll when using separate builddir
|
||||
496958 Wacom Bamboo doesn't function with GTK apps in Win32
|
||||
533891 Don't allow drag and drop from the file list into itself...
|
||||
504087 make gtk_tooltip_set_custom a no-op for setting the...
|
||||
449625 crash in gtk_tree_view_real_move_cursor
|
||||
533108 leak of GDI region in function 'handle_wm_paint'
|
||||
534694 Col id in GtkListStore could be out of range
|
||||
314084 GTK+ dialogs should not be placed partially offscreen
|
||||
529841 incorrect position in directfb
|
||||
387972 gtkassistant drawing problem
|
||||
534463 non-editable GtkTextView should not call gtk_im_context_focus_in...
|
||||
522269 Evince windows sometimes incorrectly unmaximized...
|
||||
524110 Gdk should not assume reparenting WMs...
|
||||
523562 gtk-update-icon-cache core dumps when run concurrently...
|
||||
531008 Crash in gtkprintunixdialog.c
|
||||
106574 Inconsistent increment behavior for gtkspinbutton
|
||||
511217 potential memory corruption after refreshing a tree_view
|
||||
56355 GtkLabel - Not all changes propagate correctly
|
||||
530146 Setting non-string tooltip with gtk_tree_view_set_tooltip_column...
|
||||
535862 gtk_action_create_icon can't create icons from the icon themes...
|
||||
536092 GtkEntryCompletion's popup window should set type hint
|
||||
532558 Cannot build dll when using separate builddir
|
||||
535453 gdk_pixbuf_format_get_license returns NULL for any loaders
|
||||
524862 Using GTK_WIN_POS_CENTER_ALWAYS gives jerky window resizing
|
||||
467698 crash because realizing a widget with NULL colormap
|
||||
526422 Crash in location_toggle_popup_handler
|
||||
474302 printing to an existing file overwrites without confirmation
|
||||
137717 Gtk+ filechooser should allow drag-n-drop of files in the...
|
||||
461805 The combo cell renderer is broken theme wise
|
||||
479197 Tries to search with tracker while it is uninstalled
|
||||
488820 gtk_page_setup_copy leaks
|
||||
518846 Restore toplevel maximized window
|
||||
520286 Non-deletable window has no minimize / maximize buttons.
|
||||
521442 x/y thickness is being overriden by the combobox realize ...
|
||||
521934 GtkIMSimpleContext does not send preedit_start and preedi...
|
||||
522067 compile error
|
||||
522191 overwrite-confirmation dialogs don't set alternative butt...
|
||||
522279 GtkTreeView should set type hint for search dialog
|
||||
523932 gtk-builder-convert failed on converting GLADE file
|
||||
527466 gtk_assistant_set_current_page records wrong visited page
|
||||
530153 Crash in _gtk_quartz_set_selection_data_for_pasteboard
|
||||
530156 Function keys don't work
|
||||
530963 Some suspicious code in gdkkeys-quartz.c
|
||||
467051 gdk_pixbuf_new_from_xpm_data segfaults on NULL data
|
||||
|
||||
* Translation updates:
|
||||
Belarusian Latin (be@latin)
|
||||
Catalan (ca)
|
||||
Valencian-Catalan (ca@valencia)
|
||||
Czech (cs)
|
||||
German (de)
|
||||
Greek (el)
|
||||
British English (en_GB)
|
||||
Spanish (es)
|
||||
Estonian (et)
|
||||
Basque (eu)
|
||||
French (fr)
|
||||
Galician (gl)
|
||||
Hungarian (hu)
|
||||
Italian (it)
|
||||
Japanese (ja)
|
||||
Georgian (ka)
|
||||
Korean (ko)
|
||||
Lithuanian (lt)
|
||||
Macedonian (mk)
|
||||
Dutch (nl)
|
||||
Portugese (pt)
|
||||
Slovak (sk)
|
||||
Albanian (sq)
|
||||
Swedish (sv)
|
||||
Telugu (te)
|
||||
Vietnamese (vi)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.8 to 2.12.9
|
||||
==============================================
|
||||
|
||||
* Bugs fixed:
|
||||
505085 crash in Image Viewer: I opened file name.bmp, ...
|
||||
469210 Honor CUPS user default options for GtkPrint
|
||||
507605 [patch] gtk_recent_files_menu_populate() does not guard p...
|
||||
513230 Crash when using _set_tab_reorderable but tabs are hidden
|
||||
519199 Segmentation fault on unknown widget in UI-file
|
||||
521548 printing does not work for Custom PageSize
|
||||
461805 The combo cell renderer is broken theme wise
|
||||
493406 GtkEntry doesn't get unselected when tabbing out of it
|
||||
509885 crash when browsing for other folders
|
||||
513826 configure script has no option to override cups check
|
||||
516578 gtkfilesystemwin32 leaks registry key handles
|
||||
516757 gdk/quartz scroll events don't send state
|
||||
517338 Borderless non-opaque windows get incorrectly drawn shadow
|
||||
518398 gdkwindow-win32.c: variable is declared at middle of block
|
||||
518624 bad default for GTK_PRINT_PREVIEW_COMMAND on Mac OS X
|
||||
521442 x/y thickness is being overriden by the combobox realize ...
|
||||
417389 Scrollwheel on path bar
|
||||
469868 Filenames with colon ":" are not saved correctly
|
||||
505857 filepath entered in location bar should be loaded after u...
|
||||
353196 Add a file-set signal to GtkFileChooserButton
|
||||
|
||||
* Updated translations:
|
||||
Arabic (ar)
|
||||
Assamese (as)
|
||||
British English (en_GB)
|
||||
Spanish (es)
|
||||
French (fr)
|
||||
Hungarian (hu)
|
||||
Italian (it)
|
||||
Kannada (kn)
|
||||
Norwegian bokmål (nb)
|
||||
Nepali (ne)
|
||||
Norwegian Nynorsk (nn)
|
||||
Brazilian Portugese (pt_BR)
|
||||
Russian (ru)
|
||||
Tamil (ta)
|
||||
Telugu (te)
|
||||
Turkish (tr)
|
||||
Uzbek (uz@cyrillic)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.7 to 2.12.8
|
||||
==============================================
|
||||
|
||||
* Make the directfb backend build with GLib 2.15
|
||||
|
||||
* Improve the handling of modal windows on win32
|
||||
|
||||
* GtkFileChooser:
|
||||
- Activate bookmarks on single-click
|
||||
- Improve some focus handling issues
|
||||
- Don't select filename extensions in the save dialog
|
||||
|
||||
* Bugs fixed:
|
||||
499835 No "object:state-changed:selected" event when [un]selecti...
|
||||
516024 filechooser critical warning when loading thumbnail pixbufs
|
||||
144269 GtkHPaned flickers and leaves widgets in child panels unr...
|
||||
419737 File save dialog deletes/empties filename when changing d...
|
||||
148828 Side Pane in File Selector requires double-click
|
||||
455627 Keyboard input gets confused with modal windows
|
||||
473786 Needs keyboard navigation for gtkstatusicon
|
||||
494515 GdkPixbufLoader does not always return an image at the si...
|
||||
499940 Focus shouldn't go to file list when selecting a bookmark
|
||||
503569 Leak in GtkTreeViewColumn
|
||||
505928 Right-clicking taskbar entry for minimized window causes ...
|
||||
511111 [Win32] Modal dialogs should affect the entire applicatio...
|
||||
511987 filter is not working
|
||||
514621 Crash when changing model while handling GtkTreeSelection...
|
||||
514643 Hiding a modal window still causes its parents to be blocked
|
||||
514789 Clicking a menu in a maximized windowcauses it to restore...
|
||||
515047 check for all return/space keys consistently
|
||||
515667 gtk_file_chooser_get_current_folder_uri does not check fo...
|
||||
362516 File extensions should not be selected by default
|
||||
|
||||
* Updated translations:
|
||||
Greek (el)
|
||||
Spanish (es)
|
||||
Galician (gl)
|
||||
Hebrew (he)
|
||||
Brazilian Portugese (pt_BR)
|
||||
Slovak (sk)
|
||||
Swedish (sv)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.5 to 2.12.6
|
||||
==============================================
|
||||
|
||||
* GtkBuilder supports accessibility properties and
|
||||
relations now
|
||||
|
||||
* Bugs fixed:
|
||||
506769 GtkCellRendererCombo fails for 2.12.3 under Windows
|
||||
477175 gtk_tree_view_set_cursor doesn't scroll the treeview corr...
|
||||
496645 dubious refcounting in GtkBuilder
|
||||
496651 gtkbuilder should refcount everything
|
||||
504611 A small leak fix
|
||||
507751 Conditional jump or move depends on uninitialised value(s)
|
||||
508516 Re-showing a hidden window results in wrong window position
|
||||
509153 Menu items don't get translated when using GtkBuilder
|
||||
512375 draw_page_cb leaks the pango context
|
||||
454653 GtkBuilder accessibility support
|
||||
|
||||
* Updated translations:
|
||||
Belarusian (be)
|
||||
Czech (cs)
|
||||
Estonian (et)
|
||||
French (fr)
|
||||
Sinhala (si)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.3 to 2.12.5
|
||||
==============================================
|
||||
|
||||
* Bugs fixed:
|
||||
494667 gdkpixloader jpeg loader problems with some files
|
||||
496546 Tooltips may crashe because a window is destroyed
|
||||
503824 gtk_paned_find_neighbours aborts with assertion failure
|
||||
388321 gtk_notebook_remove_tab_label
|
||||
503190 Doesn't build with directfb >= 1.0
|
||||
491847 gtk-builder-convert --root option doesn't work for GtkWin...
|
||||
492977 Setup autorelease pool automatically in each mainloop ite...
|
||||
499951 GtkAssistant remove_page may leave current_page as a dang...
|
||||
502250 Leak in gtkfilechooserdefault.c:shortcuts_reload_icons()
|
||||
503569 Leak in GtkTreeViewColumn
|
||||
504753 Destroyed subviews are not removed from the view hierarchy
|
||||
504804 Typo in TEST_EXPAND_ROW signal
|
||||
504984 Problems with hiding/showing transient windows
|
||||
505708 compatibility macros for signals has wrong type.
|
||||
506107 mem leak in print dialogue
|
||||
502850 gtk-builder-convert program not found
|
||||
504749 gtk-builder-convert and GtkMenu
|
||||
|
||||
* Updated translations:
|
||||
Greek (el)
|
||||
Spanish (es)
|
||||
Estonian (et)
|
||||
Basque (eu)
|
||||
Irish (ga)
|
||||
Swedish (sv)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.2 to 2.12.3
|
||||
==============================================
|
||||
|
||||
* Win32:
|
||||
- Respect viewable drive restrictions
|
||||
|
||||
* Bugs fixed:
|
||||
499868 fix for crash during DnD on Quartz
|
||||
500804 null pointer dereference in quartz drawing function
|
||||
144269 GtkHPaned flickers and leaves widgets in child panels unr...
|
||||
495124 Valgrind error with windows of type GTK_WINDOW_POPUP
|
||||
501583 Root window not fully initialized
|
||||
|
||||
* Updated translations:
|
||||
Estonian (et)
|
||||
French (fr)
|
||||
Irish (ga)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.1 to 2.12.2
|
||||
==============================================
|
||||
|
||||
* Bugs fixed:
|
||||
494776 text file with html causes lockeup
|
||||
482531 firefox crashed on print preview [@IA__gdk_window_get_top...
|
||||
488918 gtkbuilder cannot resolve type in turkish locale
|
||||
347585 segv in gtk_text_iter_ends_line with gcc 4.1.1 -finline-f...
|
||||
479463 gtk-builder-convert fails to convert glade files generate...
|
||||
164537 Non-modal transient dialogs should iconify with parent
|
||||
371036 Win32: Raise modal children dialogs when clicking parent ...
|
||||
388321 gtk_notebook_remove_tab_label
|
||||
405178 GTK_DIALOG_MODAL not working with gtk_message_dialog_new
|
||||
461222 gtk_builder_get_type_from_name() docs could be better
|
||||
467711 tests/testrichtext.c fails to build on HP-UX 10.20
|
||||
467722 Invalid bit-field types for AIX 4.3.3 compiler
|
||||
468793 GtkBuilder ignores <signal> after <child>
|
||||
473813 Events on the title bar "punch through" sometimes
|
||||
476827 Wrong button order in GtkAssistant
|
||||
485662 [gutsy] getting "Error Printing: Too many failed attempts...
|
||||
486369 Copy and Paste doesn't work
|
||||
486420 Allow empty property node values
|
||||
487954 Buttons with relief set to 'none' should draw a focus rect
|
||||
488017 gdkevents-win32.c: variable is declared at middle of block
|
||||
488051 Bad cursor movement when tags override visibility
|
||||
489370 Stacking order for child windows not implemented
|
||||
491207 gtk_text_buffer_delete_interactive() robustness against c...
|
||||
492117 ../gdk/quartz/GdkQuartzWindow.h:32: error: ISO C++ forbid...
|
||||
492209 The expander demo moves the whole window on the first click
|
||||
493404 Shift-tab not working in leopard
|
||||
495574 cups-config hardcoded in configure check
|
||||
495769 useless (i think) delayed_properties hashtable
|
||||
496689 GtkAboutDialog "name" property deprecation not explained ...
|
||||
497164 use text_buffer_get_insert everywhere
|
||||
499703 Text color of the calendar widget wrong for dark background
|
||||
107398 One too many frame updates for GIF animations?
|
||||
463865 gtk/gdk_window_fullscreen always uses the primary monitor
|
||||
489782 Two different default values for toolbar-style property i...
|
||||
490624 Can we have gtk-error-bell set to FALSE by default on Win...
|
||||
496734 No constant gtk_check_version return value
|
||||
496795 GtkTreeStore in a GtkBuilder XML file cannot set column t...
|
||||
498922 show-expanders code has impossible test
|
||||
467490 allow multi-file DnD with gtk-osx/quartz
|
||||
497102 Small patch for textview internals
|
||||
|
||||
* Updated translations:
|
||||
- Arabic (ar)
|
||||
- Belarusian Latin (be@latin)
|
||||
- Estonian (et)
|
||||
- Finnish (fi)
|
||||
- Irish (ga)
|
||||
- Norwegian bokmål (nb)
|
||||
- Slovenian (sl)
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.12.0 to 2.12.1
|
||||
==============================================
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 2.12.1. GTK+ is a multi-platform toolkit for
|
||||
This is GTK+ version 2.12.12. 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.
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@
|
||||
#define ENABLE_NLS 1
|
||||
|
||||
/* Define the location where the catalogs will be installed */
|
||||
#define GTK_LOCALEDIR "UNUSED"
|
||||
#define GTK_LOCALEDIR "UNUSED/share/locale"
|
||||
|
||||
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
|
||||
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
|
||||
|
||||
+44
-33
@@ -12,10 +12,10 @@ AC_PREREQ(2.54)
|
||||
|
||||
m4_define([gtk_major_version], [2])
|
||||
m4_define([gtk_minor_version], [12])
|
||||
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
|
||||
@@ -477,7 +477,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 ang ar as az az_IR be be@latin bg bn bn_IN br bs ca cs cy da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy ia id io is it ja ka ko ku li lt lv mi mk ml mn mr ms nb ne nl nn nso oc or pa pl pt pt_BR ro ru rw sk sl sq sr sr@Latn sr@ije sv ta te th tk tr tt uk ur uz uz@cyrillic vi wa xh yi zh_CN zh_HK zh_TW"
|
||||
ALL_LINGUAS="af am ang ar as az az_IR be be@latin bg bn bn_IN br bs ca ca@valencia cs cy da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy ia id io is it ja ka kn ko ku li lt lv mi mk ml mn mr ms nb ne nl nn nso oc or pa pl pt pt_BR ro ru rw si sk sl sq sr sr@Latn sr@ije sv ta te th tk tr tt uk ur uz uz@cyrillic 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*)
|
||||
@@ -1551,42 +1551,53 @@ AC_SUBST(GTK_XIM_FLAGS)
|
||||
# Printing system checks
|
||||
################################################################
|
||||
|
||||
AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
|
||||
if test "x$CUPS_CONFIG" != "xno"; then
|
||||
CUPS_CFLAGS=`cups-config --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
|
||||
CUPS_LIBS=`cups-config --libs`
|
||||
AC_ARG_ENABLE(cups,
|
||||
[AC_HELP_STRING([--disable-cups]
|
||||
[disable cups print backend])],,
|
||||
[enable_cups=auto])
|
||||
|
||||
CUPS_API_VERSION=`cups-config --api-version`
|
||||
CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'`
|
||||
CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'`
|
||||
if test "x$enable_cups" = "xauto"
|
||||
then
|
||||
AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
|
||||
if test "x$CUPS_CONFIG" != "xno"; then
|
||||
CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
|
||||
CUPS_LIBS=`$CUPS_CONFIG --libs`
|
||||
|
||||
if test $CUPS_API_MAJOR -gt 1 -o \
|
||||
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then
|
||||
AC_DEFINE(HAVE_CUPS_API_1_2)
|
||||
CUPS_API_VERSION=`$CUPS_CONFIG --api-version`
|
||||
CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'`
|
||||
CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'`
|
||||
|
||||
if test $CUPS_API_MAJOR -gt 1 -o \
|
||||
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then
|
||||
AC_DEFINE(HAVE_CUPS_API_1_2)
|
||||
fi
|
||||
|
||||
AC_SUBST(CUPS_API_MAJOR)
|
||||
AC_SUBST(CUPS_API_MINOR)
|
||||
AC_SUBST(CUPS_CFLAGS)
|
||||
AC_SUBST(CUPS_LIBS)
|
||||
|
||||
AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
|
||||
|
||||
AC_SUBST(CUPS_API_MAJOR)
|
||||
AC_SUBST(CUPS_API_MINOR)
|
||||
AC_SUBST(CUPS_CFLAGS)
|
||||
AC_SUBST(CUPS_LIBS)
|
||||
gtk_save_cflags="$CFLAGS"
|
||||
CFLAGS="$CUPS_CFLAGS"
|
||||
AC_TRY_COMPILE([#include <cups/http.h>],
|
||||
[http_t http; char *s = http.authstring;],
|
||||
[AC_DEFINE(HAVE_HTTP_AUTHSTRING,[],[Define if cups http_t authstring field is accessible])],)
|
||||
CFLAGS="$gtk_save_cflags"
|
||||
|
||||
AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
|
||||
AC_SUBST(HAVE_HTTP_AUTHSTRING)
|
||||
|
||||
gtk_save_libs="$LIBS"
|
||||
LIBS="$CUPS_LIBS"
|
||||
AC_CHECK_FUNCS(httpGetAuthString)
|
||||
LIBS="$gtk_save_libs"
|
||||
|
||||
else
|
||||
AM_CONDITIONAL(HAVE_CUPS, false)
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
|
||||
|
||||
gtk_save_cflags="$CFLAGS"
|
||||
CFLAGS="$CUPS_CFLAGS"
|
||||
AC_TRY_COMPILE([#include <cups/http.h>],
|
||||
[http_t http; char *s = http.authstring;],
|
||||
[AC_DEFINE(HAVE_HTTP_AUTHSTRING,[],[Define if cups http_t authstring field is accessible])],)
|
||||
CFLAGS="$gtk_save_cflags"
|
||||
|
||||
AC_SUBST(HAVE_HTTP_AUTHSTRING)
|
||||
|
||||
gtk_save_libs="$LIBS"
|
||||
LIBS="$CUPS_LIBS"
|
||||
AC_CHECK_FUNCS(httpGetAuthString)
|
||||
LIBS="$gtk_save_libs"
|
||||
|
||||
gtk_save_cppflags="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
|
||||
|
||||
@@ -1,3 +1,47 @@
|
||||
2008-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.12 ===
|
||||
|
||||
2008-07-01 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.11 ===
|
||||
|
||||
2008-06-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.10 ===
|
||||
|
||||
2008-03-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.9 ===
|
||||
|
||||
2008-02-12 Matthias Clasen <mclasne@redhat.com>
|
||||
|
||||
* === Released 2.12.8 ===
|
||||
|
||||
2008-01-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.7 ===
|
||||
|
||||
2008-01-28 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.6 ===
|
||||
|
||||
2008-01-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.5 ===
|
||||
|
||||
2008-01-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.4 ===
|
||||
|
||||
2007-12-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.3 ===
|
||||
|
||||
2007-11-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.2 ===
|
||||
|
||||
2007-10-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.1 ===
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "demo-common.h"
|
||||
|
||||
void
|
||||
G_MODULE_EXPORT void
|
||||
quit_activate (GtkAction *action)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
G_MODULE_EXPORT void
|
||||
about_activate (GtkAction *action)
|
||||
{
|
||||
GtkWidget *about_dlg;
|
||||
|
||||
@@ -49,6 +49,7 @@ begin_print (GtkPrintOperation *operation,
|
||||
|
||||
data->num_lines = i;
|
||||
data->num_pages = (data->num_lines - 1) / data->lines_per_page + 1;
|
||||
|
||||
gtk_print_operation_set_n_pages (operation, data->num_pages);
|
||||
}
|
||||
|
||||
@@ -122,7 +123,7 @@ draw_page (GtkPrintOperation *operation,
|
||||
{
|
||||
pango_layout_set_text (layout, data->lines[line], -1);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
cairo_rel_move_to (cr, 0, data->font_size);
|
||||
cairo_rel_move_to (cr, 0, text_height);
|
||||
line++;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,77 @@
|
||||
2008-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.12 ===
|
||||
|
||||
2008-07-01 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.11 ===
|
||||
|
||||
2008-06-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.10 ===
|
||||
|
||||
2008-04-10 Cody Russell <bratsche@gnome.org>
|
||||
|
||||
* docs/reference/gdk/tmpl/windows.sgml: Fix to say
|
||||
g_signal_connect_after rather than g_signal_register_after.
|
||||
(reported by Guillaume Cottenceau)
|
||||
|
||||
2008-04-10 Cody Russell <bratsche@gnome.org>
|
||||
|
||||
* docs/reference/gtk/tmpl/gtktreeview.sgml: Fix a typo
|
||||
in the markup. (reported by kraai -at- ftbfs.org)
|
||||
|
||||
2008-03-30 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
Bug 524862 - Using GTK_WIN_POS_CENTER_ALWAYS gives jerky window
|
||||
resizing in Win32
|
||||
|
||||
* gtk/tmpl/gtkenums.sgml: Recommend that GTK_WIN_POS_CENTER_ALWAYS
|
||||
is not used.
|
||||
|
||||
2008-03-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.9 ===
|
||||
|
||||
2008-02-12 Matthias Clasen <mclasne@redhat.com>
|
||||
|
||||
* === Released 2.12.8 ===
|
||||
|
||||
2008-01-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.7 ===
|
||||
|
||||
2008-01-28 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.6 ===
|
||||
|
||||
2008-01-24 Johan Dahlin <johan@gnome.org>
|
||||
|
||||
* gtk/tmpl/gtkwidget.sgml:
|
||||
Add documentation for <accessible> buildable tag.
|
||||
|
||||
2008-01-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.5 ===
|
||||
|
||||
2008-01-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.4 ===
|
||||
|
||||
2007-12-30 Johannes Schmid <jhs@gnome.org>
|
||||
|
||||
* gtk/tmpl/gtknotebook.sgml:
|
||||
Fix method names (gtk_notebook_popup_enable vs.
|
||||
gtk_notebook_enable_popup)
|
||||
|
||||
2007-12-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.3 ===
|
||||
|
||||
2007-11-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.2 ===
|
||||
|
||||
2007-11-19 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/tmpl/gtkaboutdialog.sgml: Add some hints about
|
||||
|
||||
@@ -50,7 +50,7 @@ transparent_expose (GtkWidget *widget,
|
||||
*
|
||||
* In this case we do not want app-paintable to be set on the widget
|
||||
* since we want it to draw its own (red) background. Because of this,
|
||||
* however, we must ensure that we use g_signal_register_after so that
|
||||
* however, we must ensure that we use g_signal_connect_after so that
|
||||
* this handler is called after the red has been drawn. If it was
|
||||
* called before then GTK would just blindly paint over our work.
|
||||
*
|
||||
|
||||
@@ -61,7 +61,8 @@ a GtkBuilder UI definition.
|
||||
@construct_child: Constructs a child of a buildable that has been
|
||||
specified as "constructor" in the UI definition. #GtkUIManager implements
|
||||
this to reference to a widget created in a <ui> tag which is outside
|
||||
of the normal GtkBuilder UI definition hierarchy.
|
||||
of the normal GtkBuilder UI definition hierarchy. A reference to the
|
||||
constructed object is returned and becomes owned by the caller.
|
||||
@custom_tag_start: Implement this if the buildable needs to parse
|
||||
content below <child>. To handle an element, the implementation
|
||||
must fill in the @parser structure and @user_data and return %TRUE.
|
||||
|
||||
@@ -442,7 +442,9 @@ Used by #GtkCList and #GtkCTree to indicate whether a row is visible.
|
||||
|
||||
<!-- ##### ENUM GtkWindowPosition ##### -->
|
||||
<para>
|
||||
Window placement can be influenced using this enumeration.
|
||||
Window placement can be influenced using this enumeration. Note that
|
||||
using #GTK_WIN_POS_CENTER_ALWAYS is almost always a bad idea.
|
||||
It won't necessarily work well with all window managers or on all windowing systems.
|
||||
</para>
|
||||
|
||||
@GTK_WIN_POS_NONE: No influence is made on placement.
|
||||
|
||||
@@ -16,7 +16,7 @@ things, you can choose on which edge the tabs appear
|
||||
tabs to fit the noteobook should be made bigger or scrolling
|
||||
arrows added (see gtk_notebook_set_scrollable), and whether there
|
||||
will be a popup menu allowing the users to switch pages.
|
||||
(see gtk_notebook_enable_popup(), gtk_noteobook_disable_popup())
|
||||
(see gtk_notebook_popup_enable(), gtk_noteobook_popup_disable())
|
||||
</para>
|
||||
|
||||
<refsect2 id="GtkNotebook-BUILDER-UI">
|
||||
|
||||
@@ -134,6 +134,8 @@ Tells about the state of the object.
|
||||
|
||||
@GTK_IN_DESTRUCTION: the object is currently being destroyed. This is used
|
||||
internally by GTK+ to prevent reinvokations during destruction.
|
||||
@GTK_FLOATING:
|
||||
@GTK_RESERVED_1:
|
||||
@GTK_RESERVED_2: reserved for future use
|
||||
|
||||
<!-- ##### MACRO GTK_OBJECT_FLAGS ##### -->
|
||||
|
||||
@@ -52,6 +52,8 @@ accessed through the function described below.
|
||||
@orientation:
|
||||
@style:
|
||||
@icon_size:
|
||||
@tooltips:
|
||||
@_tooltips:
|
||||
|
||||
<!-- ##### SIGNAL GtkToolbar::focus-home-or-end ##### -->
|
||||
<para>
|
||||
|
||||
@@ -58,7 +58,7 @@ GtkTreeViewColumn objects as <child> elements in UI definitions.
|
||||
<property name="title">Test</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>"
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
|
||||
@@ -37,6 +37,31 @@ modifiers and signal and allows to specify accelerators.
|
||||
</object>
|
||||
]]></programlisting>
|
||||
</example>
|
||||
In addition to accelerators, <structname>GtkWidget</structname> also support a
|
||||
custom <accessible> element, which supports actions and relations.
|
||||
Properties on the accessible implementation of an object can be set by accessing the
|
||||
internal child "accessible" of a <structname>GtkWidget</structname>.
|
||||
<example>
|
||||
<title>A UI definition fragment specifying an accessible</title>
|
||||
<programlisting><![CDATA[
|
||||
<object class="GtkButton" id="label1"/>
|
||||
<property name="label">I am a Label for a Button</property>
|
||||
</object>
|
||||
<object class="GtkButton" id="button1">
|
||||
<accessibility>
|
||||
<action action_name="click" description="Click the button."/>
|
||||
<relation target="label1" type="labelled-by"/>
|
||||
</accessibility>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-button1">
|
||||
<property name="AtkObject::name">Clickable Button</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
]]></programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
|
||||
@@ -1,3 +1,157 @@
|
||||
2008-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.12 ===
|
||||
|
||||
2008-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from trunk:
|
||||
|
||||
* gdk-pixbuf-io.c: Plug a small memory leak
|
||||
|
||||
Bug 517233 - Calling gdk_pixbuf_loader_close causes "GError set over
|
||||
the top of a previous GError" warning
|
||||
|
||||
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Don't overwrite
|
||||
errors. Reported by Andrey Tsyvarev
|
||||
|
||||
2008-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from trunk:
|
||||
|
||||
Bug 517233 - Calling gdk_pixbuf_loader_close causes "GError set over
|
||||
the top of a previous GError" warning
|
||||
|
||||
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Don't overwrite
|
||||
errors. Reported by Andrey Tsyvarev
|
||||
|
||||
2008-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from trunk:
|
||||
|
||||
Bug 549711 - Race condition when loading gdk-pixbuf image modules
|
||||
|
||||
* gdk-pixbuf-io.c: Fix a race condition in module loading,
|
||||
spotted by Chris Lord.
|
||||
|
||||
2008-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from trunk:
|
||||
|
||||
Bug 532644 - TIFF loader need to exclude CR2 files
|
||||
|
||||
* io-tiff.c: Add a pattern to exclude CR2 files.
|
||||
Noticed by Hubert Figuire
|
||||
|
||||
2008-09-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from trunk:
|
||||
|
||||
* gdk-pixbuf-utils.c (gdk_pixbuf_saturate_and_pixelate):
|
||||
Use gdk_pixbuf_copy_area() to copy between pixbufs.
|
||||
Reported by Andrey Tsyvarev
|
||||
|
||||
2008-07-01 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.11 ===
|
||||
|
||||
2008-06-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merged from trunk:
|
||||
|
||||
* io-ico.c: Add image/x-win-bitmap to the supported mimetypes,
|
||||
since that is what shared-mime-info uses for .cur
|
||||
|
||||
2008-06-03 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.10 ===
|
||||
|
||||
2008-06-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from trunk:
|
||||
|
||||
Bug 535453 - gdk_pixbuf_format_get_license returns NULL for
|
||||
any of the loaders
|
||||
|
||||
* queryloaders.c (write_loader_info): Add the license info
|
||||
after the description.
|
||||
|
||||
* gdk-pixbuf-io.c (gdk_pixbuf_io_init): Read the license info
|
||||
from the module file. Reported by Andrey Tsyvarev.
|
||||
|
||||
2008-06-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from trunk:
|
||||
|
||||
* gdk-pixbuf-io.c (gdk_pixbuf_new_from_xpm_data): Guard
|
||||
against NULL pointer. (#467051, Gian Mario Tagliaretti)
|
||||
|
||||
2008-05-12 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
Bug 532558 - Cannot build dll when using separate builddir
|
||||
|
||||
* Makefile.am: .def file belongs in $(srcdir). Patch by Marko
|
||||
Lindqvist.
|
||||
|
||||
2008-03-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.9 ===
|
||||
|
||||
2008-03-11 Claudio Saavedra <csaavedra@alumnos.utalca.cl>
|
||||
|
||||
* io-bmp.c: (gdk_pixbuf__bmp_image_stop_load): Set a
|
||||
GDK_ERROR_CORRUPT_IMAGE error if the loader is closed while
|
||||
still reading the headers. (#505085)
|
||||
|
||||
2008-03-11 Claudio Saavedra <csaavedra@alumnos.utalca.cl>
|
||||
|
||||
* io-bmp.c: (DecodeHeader): Check for the BMP header magic numbers
|
||||
before decoding it. (#505085)
|
||||
|
||||
2008-02-12 Matthias Clasen <mclasne@redhat.com>
|
||||
|
||||
* === Released 2.12.8 ===
|
||||
|
||||
2008-02-12 Matthias Clasen <mclasne@redhat.com>
|
||||
|
||||
* gdk-pixbuf-io.c (at_scale_size_prepared_cb): Don't let
|
||||
the width or height go below 1. (#516024, Christian Persch)
|
||||
|
||||
2008-02-10 Matthias Clasen <mclasne@redhat.com>
|
||||
|
||||
* gdk-pixbuf-scaled-anim.c: Try harder to return pixbufs
|
||||
of the requested size. (#494515, Mike Morrison)
|
||||
|
||||
2008-01-29 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.7 ===
|
||||
|
||||
2008-01-28 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.6 ===
|
||||
|
||||
2008-01-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.5 ===
|
||||
|
||||
2008-01-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.4 ===
|
||||
|
||||
2007-12-09 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Merge from trunk:
|
||||
|
||||
* io-jpeg.c: Fix the spinguard logic for big buffers.
|
||||
(#494667, Ed Catmur)
|
||||
|
||||
2007-12-04 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.3 ===
|
||||
|
||||
2007-11-26 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* === Released 2.12.2 ===
|
||||
|
||||
2007-11-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-jpeg.c: Avoid unaligned accesses that cause
|
||||
|
||||
@@ -7,7 +7,7 @@ endif
|
||||
|
||||
if OS_WIN32
|
||||
gdk_pixbuf_def = gdk_pixbuf.def
|
||||
gdk_pixbuf_symbols = -export-symbols gdk_pixbuf.def
|
||||
gdk_pixbuf_symbols = -export-symbols $(srcdir)/gdk_pixbuf.def
|
||||
|
||||
gdk_pixbuf_win32_res = gdk_pixbuf-win32-res.o
|
||||
gdk_pixbuf_win32_res_ldflag = -Wl,gdk_pixbuf-win32-res.o
|
||||
@@ -16,7 +16,7 @@ gdk_pixbuf-win32-res.o : gdk_pixbuf.rc
|
||||
$(WINDRES) gdk_pixbuf.rc $@
|
||||
|
||||
install-def-file:
|
||||
$(INSTALL) gdk_pixbuf.def $(DESTDIR)$(libdir)/gdk_pixbuf-$(GTK_API_VERSION).def
|
||||
$(INSTALL) $(srcdir)/gdk_pixbuf.def $(DESTDIR)$(libdir)/gdk_pixbuf-$(GTK_API_VERSION).def
|
||||
uninstall-def-file:
|
||||
-rm $(DESTDIR)$(libdir)/gdk_pixbuf-$(GTK_API_VERSION).def
|
||||
else
|
||||
@@ -40,8 +40,10 @@ install-ms-lib:
|
||||
uninstall-ms-lib:
|
||||
endif
|
||||
|
||||
# This places the generated .def file in srcdir, since it is expected to be there.
|
||||
# (The one from a tarball is)
|
||||
gdk_pixbuf.def: gdk-pixbuf.symbols
|
||||
(echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gdk-pixbuf.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > gdk_pixbuf.def
|
||||
(echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gdk-pixbuf.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > $(srcdir)/gdk_pixbuf.def
|
||||
|
||||
gdk-pixbuf-alias.h: gdk-pixbuf.symbols
|
||||
$(PERL) $(srcdir)/makegdkpixbufalias.pl < $(srcdir)/gdk-pixbuf.symbols > gdk-pixbuf-alias.h
|
||||
|
||||
+94
-83
@@ -284,6 +284,11 @@ gdk_pixbuf_get_module_file (void)
|
||||
|
||||
#endif /* USE_GMODULE */
|
||||
|
||||
|
||||
static gboolean
|
||||
gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
|
||||
GError **error);
|
||||
|
||||
static void
|
||||
gdk_pixbuf_io_init (void)
|
||||
{
|
||||
@@ -305,7 +310,7 @@ gdk_pixbuf_io_init (void)
|
||||
#define load_one_builtin_module(format) \
|
||||
builtin_module = g_new0 (GdkPixbufModule, 1); \
|
||||
builtin_module->module_name = #format; \
|
||||
if (_gdk_pixbuf_load_module (builtin_module, NULL)) \
|
||||
if (gdk_pixbuf_load_module_unlocked (builtin_module, NULL)) \
|
||||
file_formats = g_slist_prepend (file_formats, builtin_module);\
|
||||
else \
|
||||
g_free (builtin_module)
|
||||
@@ -362,6 +367,8 @@ gdk_pixbuf_io_init (void)
|
||||
if (file_formats == NULL)
|
||||
g_warning ("Cannot open pixbuf loader module file '%s': %s",
|
||||
filename, error->message);
|
||||
g_string_free (tmp_buf, TRUE);
|
||||
g_free (filename);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -433,6 +440,10 @@ gdk_pixbuf_io_init (void)
|
||||
have_error = TRUE;
|
||||
}
|
||||
module->info->description = g_strdup (tmp_buf->str);
|
||||
|
||||
if (scan_string (&p, tmp_buf)) {
|
||||
module->info->license = g_strdup (tmp_buf->str);
|
||||
}
|
||||
}
|
||||
else if (!module->info->mime_types) {
|
||||
int n = 1;
|
||||
@@ -502,50 +513,6 @@ gdk_pixbuf_io_init (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef USE_GMODULE
|
||||
|
||||
/* actually load the image handler - gdk_pixbuf_get_module only get a */
|
||||
/* reference to the module to load, it doesn't actually load it */
|
||||
/* perhaps these actions should be combined in one function */
|
||||
static gboolean
|
||||
_gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
|
||||
GError **error)
|
||||
{
|
||||
char *path;
|
||||
GModule *module;
|
||||
gpointer sym;
|
||||
|
||||
g_return_val_if_fail (image_module->module == NULL, FALSE);
|
||||
|
||||
path = image_module->module_path;
|
||||
module = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
|
||||
|
||||
if (!module) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Unable to load image-loading module: %s: %s"),
|
||||
path, g_module_error ());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
image_module->module = module;
|
||||
|
||||
if (g_module_symbol (module, "fill_vtable", &sym)) {
|
||||
GdkPixbufModuleFillVtableFunc func = (GdkPixbufModuleFillVtableFunc) sym;
|
||||
(* func) (image_module);
|
||||
return TRUE;
|
||||
} else {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Image-loading module %s does not export the proper interface; perhaps it's from a different GTK version?"),
|
||||
path);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* !USE_GMODULE */
|
||||
|
||||
#define module(type) \
|
||||
extern void _gdk_pixbuf__##type##_fill_info (GdkPixbufFormat *info); \
|
||||
@@ -568,15 +535,19 @@ module (pcx);
|
||||
|
||||
#undef module
|
||||
|
||||
gboolean
|
||||
_gdk_pixbuf_load_module (GdkPixbufModule *image_module,
|
||||
GError **error)
|
||||
/* actually load the image handler - gdk_pixbuf_get_module only get a */
|
||||
/* reference to the module to load, it doesn't actually load it */
|
||||
/* perhaps these actions should be combined in one function */
|
||||
static gboolean
|
||||
gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret;
|
||||
gboolean locked = FALSE;
|
||||
GdkPixbufModuleFillInfoFunc fill_info = NULL;
|
||||
GdkPixbufModuleFillVtableFunc fill_vtable = NULL;
|
||||
|
||||
if (image_module->module != NULL)
|
||||
return TRUE;
|
||||
|
||||
#define try_module(format) \
|
||||
if (fill_info == NULL && \
|
||||
strcmp (image_module->module_name, #format) == 0) { \
|
||||
@@ -636,32 +607,72 @@ _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
else
|
||||
#ifdef USE_GMODULE
|
||||
|
||||
/* be extra careful, maybe the module initializes
|
||||
* the thread system
|
||||
*/
|
||||
if (g_threads_got_initialized)
|
||||
{
|
||||
G_LOCK (init_lock);
|
||||
locked = TRUE;
|
||||
}
|
||||
ret = _gdk_pixbuf_load_module_unlocked (image_module, error);
|
||||
if (locked)
|
||||
G_UNLOCK (init_lock);
|
||||
return ret;
|
||||
char *path;
|
||||
GModule *module;
|
||||
gpointer sym;
|
||||
|
||||
path = image_module->module_path;
|
||||
module = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
|
||||
|
||||
if (!module) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Unable to load image-loading module: %s: %s"),
|
||||
path, g_module_error ());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
image_module->module = module;
|
||||
|
||||
if (g_module_symbol (module, "fill_vtable", &sym)) {
|
||||
fill_vtable = (GdkPixbufModuleFillVtableFunc) sym;
|
||||
(* fill_vtable) (image_module);
|
||||
return TRUE;
|
||||
} else {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_FAILED,
|
||||
_("Image-loading module %s does not export the proper interface; perhaps it's from a different GTK version?"),
|
||||
path);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
|
||||
_("Image type '%s' is not supported"),
|
||||
image_module->module_name);
|
||||
|
||||
return FALSE;
|
||||
#endif /* !USE_GMODULE */
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
gboolean
|
||||
_gdk_pixbuf_load_module (GdkPixbufModule *image_module,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret;
|
||||
gboolean locked = FALSE;
|
||||
|
||||
/* be extra careful, maybe the module initializes
|
||||
* the thread system
|
||||
*/
|
||||
if (g_threads_got_initialized) {
|
||||
G_LOCK (init_lock);
|
||||
locked = TRUE;
|
||||
}
|
||||
|
||||
ret = gdk_pixbuf_load_module_unlocked (image_module, error);
|
||||
|
||||
if (locked)
|
||||
G_UNLOCK (init_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -870,12 +881,11 @@ gdk_pixbuf_new_from_file (const char *filename,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (image_module->module == NULL)
|
||||
if (!_gdk_pixbuf_load_module (image_module, error)) {
|
||||
g_free (display_name);
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
if (!_gdk_pixbuf_load_module (image_module, error)) {
|
||||
g_free (display_name);
|
||||
fclose (f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fseek (f, 0, SEEK_SET);
|
||||
pixbuf = _gdk_pixbuf_generic_image_load (image_module, f, error);
|
||||
@@ -975,6 +985,9 @@ size_prepared_cb (GdkPixbufLoader *loader,
|
||||
height = info->height;
|
||||
}
|
||||
|
||||
width = MAX (width, 1);
|
||||
height = MAX (height, 1);
|
||||
|
||||
gdk_pixbuf_loader_set_size (loader, width, height);
|
||||
}
|
||||
|
||||
@@ -1297,6 +1310,8 @@ gdk_pixbuf_new_from_xpm_data (const char **data)
|
||||
GdkPixbufModule *xpm_module;
|
||||
gboolean locked;
|
||||
|
||||
g_return_val_if_fail (data != NULL, NULL);
|
||||
|
||||
xpm_module = _gdk_pixbuf_get_named_module ("xpm", &error);
|
||||
if (xpm_module == NULL) {
|
||||
g_warning ("Error loading XPM image loader: %s", error->message);
|
||||
@@ -1304,12 +1319,10 @@ gdk_pixbuf_new_from_xpm_data (const char **data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (xpm_module->module == NULL) {
|
||||
if (!_gdk_pixbuf_load_module (xpm_module, &error)) {
|
||||
g_warning ("Error loading XPM image loader: %s", error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
if (!_gdk_pixbuf_load_module (xpm_module, &error)) {
|
||||
g_warning ("Error loading XPM image loader: %s", error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
locked = _gdk_pixbuf_lock (xpm_module);
|
||||
@@ -1402,9 +1415,8 @@ gdk_pixbuf_real_save (GdkPixbuf *pixbuf,
|
||||
if (image_module == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (image_module->module == NULL)
|
||||
if (!_gdk_pixbuf_load_module (image_module, error))
|
||||
return FALSE;
|
||||
if (!_gdk_pixbuf_load_module (image_module, error))
|
||||
return FALSE;
|
||||
|
||||
locked = _gdk_pixbuf_lock (image_module);
|
||||
|
||||
@@ -1533,9 +1545,8 @@ gdk_pixbuf_real_save_to_callback (GdkPixbuf *pixbuf,
|
||||
if (image_module == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (image_module->module == NULL)
|
||||
if (!_gdk_pixbuf_load_module (image_module, error))
|
||||
return FALSE;
|
||||
if (!_gdk_pixbuf_load_module (image_module, error))
|
||||
return FALSE;
|
||||
|
||||
locked = _gdk_pixbuf_lock (image_module);
|
||||
|
||||
|
||||
@@ -356,9 +356,8 @@ gdk_pixbuf_loader_load_module (GdkPixbufLoader *loader,
|
||||
if (priv->image_module == NULL)
|
||||
return 0;
|
||||
|
||||
if (priv->image_module->module == NULL)
|
||||
if (!_gdk_pixbuf_load_module (priv->image_module, error))
|
||||
return 0;
|
||||
if (!_gdk_pixbuf_load_module (priv->image_module, error))
|
||||
return 0;
|
||||
|
||||
if (priv->image_module->module == NULL)
|
||||
return 0;
|
||||
@@ -727,8 +726,12 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
|
||||
* here, since we might not get an error in the
|
||||
* gdk_pixbuf_get_file_info() case
|
||||
*/
|
||||
if (tmp)
|
||||
g_propagate_error (error, tmp);
|
||||
if (tmp) {
|
||||
if (error && *error == NULL)
|
||||
g_propagate_error (error, tmp);
|
||||
else
|
||||
g_error_free (tmp);
|
||||
}
|
||||
retval = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,8 +139,8 @@ get_scaled_pixbuf (GdkPixbufScaledAnim *scaled,
|
||||
|
||||
/* Get a new scaled pixbuf */
|
||||
scaled->current = gdk_pixbuf_scale_simple (pixbuf,
|
||||
(int) (gdk_pixbuf_get_width (pixbuf) * scaled->xscale),
|
||||
(int) (gdk_pixbuf_get_height (pixbuf) * scaled->yscale),
|
||||
(int) (gdk_pixbuf_get_width (pixbuf) * scaled->xscale + .5),
|
||||
(int) (gdk_pixbuf_get_height (pixbuf) * scaled->yscale + .5),
|
||||
GDK_INTERP_BILINEAR);
|
||||
|
||||
/* Copy the original pixbuf options to the scaled pixbuf */
|
||||
@@ -170,9 +170,9 @@ get_size (GdkPixbufAnimation *anim,
|
||||
|
||||
GDK_PIXBUF_ANIMATION_GET_CLASS (scaled->anim)->get_size (scaled->anim, width, height);
|
||||
if (width)
|
||||
*width = (int)(*width * scaled->xscale);
|
||||
*width = (int)(*width * scaled->xscale + .5);
|
||||
if (height)
|
||||
*height = (int)(*height * scaled->yscale);
|
||||
*height = (int)(*height * scaled->yscale + .5);
|
||||
}
|
||||
|
||||
static GdkPixbufAnimationIter *
|
||||
|
||||
@@ -190,9 +190,10 @@ gdk_pixbuf_saturate_and_pixelate(const GdkPixbuf *src,
|
||||
|
||||
if (saturation == 1.0 && !pixelate) {
|
||||
if (dest != src)
|
||||
memcpy (gdk_pixbuf_get_pixels (dest),
|
||||
gdk_pixbuf_get_pixels (src),
|
||||
gdk_pixbuf_get_height (src) * gdk_pixbuf_get_rowstride (src));
|
||||
gdk_pixbuf_copy_area (src, 0, 0,
|
||||
gdk_pixbuf_get_width (src),
|
||||
gdk_pixbuf_get_height (src),
|
||||
dest, 0, 0);
|
||||
} else {
|
||||
int i, j, t;
|
||||
int width, height, has_alpha, src_rowstride, dest_rowstride, bytes_per_pixel;
|
||||
|
||||
+24
-1
@@ -258,6 +258,17 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
|
||||
{
|
||||
gint clrUsed;
|
||||
|
||||
/* First check for the two first bytes content. A sane
|
||||
BMP file must start with bytes 0x42 0x4D. */
|
||||
if (*BFH != 0x42 || *(BFH + 1) != 0x4D) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("BMP image has bogus header data"));
|
||||
State->read_state = READ_STATE_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* FIXME this is totally unrobust against bogus image data. */
|
||||
if (State->BufferSize < lsb_32 (&BIH[0]) + 14) {
|
||||
State->BufferSize = lsb_32 (&BIH[0]) + 14;
|
||||
@@ -682,6 +693,8 @@ gdk_pixbuf__bmp_image_begin_load(GdkPixbufModuleSizeFunc size_func,
|
||||
*/
|
||||
static gboolean gdk_pixbuf__bmp_image_stop_load(gpointer data, GError **error)
|
||||
{
|
||||
gboolean retval = TRUE;
|
||||
|
||||
struct bmp_progressive_state *context =
|
||||
(struct bmp_progressive_state *) data;
|
||||
|
||||
@@ -696,10 +709,20 @@ static gboolean gdk_pixbuf__bmp_image_stop_load(gpointer data, GError **error)
|
||||
if (context->pixbuf)
|
||||
g_object_unref(context->pixbuf);
|
||||
|
||||
if (context->read_state == READ_STATE_HEADERS) {
|
||||
if (error && *error == NULL) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("Premature end-of-file encountered"));
|
||||
}
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
g_free(context->buff);
|
||||
g_free(context);
|
||||
|
||||
return TRUE;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1210,6 +1210,7 @@ MODULE_ENTRY (ico, fill_info) (GdkPixbufFormat *info)
|
||||
static gchar * mime_types[] = {
|
||||
"image/x-icon",
|
||||
"image/x-ico",
|
||||
"image/x-win-bitmap",
|
||||
NULL
|
||||
};
|
||||
static gchar * extensions[] = {
|
||||
|
||||
@@ -812,7 +812,7 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
struct jpeg_decompress_struct *cinfo;
|
||||
my_src_ptr src;
|
||||
guint num_left, num_copy;
|
||||
guint last_bytes_left;
|
||||
guint last_num_left, last_bytes_left;
|
||||
guint spinguard;
|
||||
gboolean first;
|
||||
const guchar *bufhd;
|
||||
@@ -853,6 +853,7 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
if (num_left == 0)
|
||||
return TRUE;
|
||||
|
||||
last_num_left = num_left;
|
||||
last_bytes_left = 0;
|
||||
spinguard = 0;
|
||||
first = TRUE;
|
||||
@@ -880,10 +881,13 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
if (first) {
|
||||
last_bytes_left = src->pub.bytes_in_buffer;
|
||||
first = FALSE;
|
||||
} else if (src->pub.bytes_in_buffer == last_bytes_left)
|
||||
} else if (src->pub.bytes_in_buffer == last_bytes_left
|
||||
&& num_left == last_num_left) {
|
||||
spinguard++;
|
||||
else
|
||||
} else {
|
||||
last_bytes_left = src->pub.bytes_in_buffer;
|
||||
last_num_left = num_left;
|
||||
}
|
||||
|
||||
/* should not go through twice and not pull bytes out of buf */
|
||||
if (spinguard > 2)
|
||||
|
||||
@@ -799,6 +799,7 @@ MODULE_ENTRY (tiff, fill_info) (GdkPixbufFormat *info)
|
||||
static GdkPixbufModulePattern signature[] = {
|
||||
{ "MM \x2a", " z ", 100 },
|
||||
{ "II\x2a ", " z", 100 },
|
||||
{ "II* \020 CR\002 ", " z zzz z", 0 },
|
||||
{ NULL, NULL, 0 }
|
||||
};
|
||||
static gchar * mime_types[] = {
|
||||
|
||||
+5
-3
@@ -161,11 +161,11 @@ libgdk_win32_2_0_la_SOURCES = $(common_sources) gdkkeynames.c
|
||||
libgdk_win32_2_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS) \
|
||||
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
|
||||
libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
|
||||
libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols gdk.def $(LDADD)
|
||||
libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
|
||||
|
||||
if OS_WIN32
|
||||
install-def-file: gdk.def
|
||||
$(INSTALL) gdk.def $(DESTDIR)$(libdir)/gdk-win32-2.0.def
|
||||
$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-2.0.def
|
||||
uninstall-def-file:
|
||||
-rm $(DESTDIR)$(libdir)/gdk-win32-2.0.def
|
||||
else
|
||||
@@ -189,8 +189,10 @@ install-ms-lib:
|
||||
uninstall-ms-lib:
|
||||
endif
|
||||
|
||||
# This places the generated .def file in srcdir, since it is expected to be there.
|
||||
# (The one from a tarball is)
|
||||
gdk.def: gdk.symbols
|
||||
(echo -e EXPORTS; $(CPP) -P -DALL_FILES -DGDK_WINDOWING_WIN32 -DINCLUDE_VARIABLES - <$(srcdir)/gdk.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > gdk.def
|
||||
(echo -e EXPORTS; $(CPP) -P -DALL_FILES -DGDK_WINDOWING_WIN32 -DINCLUDE_VARIABLES - <$(srcdir)/gdk.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > $(srcdir)/gdk.def
|
||||
|
||||
gdkalias.h: gdk.symbols
|
||||
$(PERL) $(srcdir)/makegdkalias.pl < $(srcdir)/gdk.symbols > gdkalias.h
|
||||
|
||||
@@ -39,6 +39,13 @@
|
||||
|
||||
#include "x-cursors.xbm"
|
||||
|
||||
#include <directfb_version.h>
|
||||
|
||||
#if DIRECTFB_MAJOR_VERSION < 1
|
||||
#define u32 __u32
|
||||
#define u8 __u8
|
||||
#endif
|
||||
|
||||
static struct {
|
||||
const guchar *bits;
|
||||
int width, height, hotx, hoty;
|
||||
@@ -228,7 +235,7 @@ gdk_cursor_new_for_display (GdkDisplay *display,GdkCursorType cursor_type)
|
||||
}
|
||||
else
|
||||
{
|
||||
__u32 *dst;
|
||||
u32 *dst;
|
||||
int pitch;
|
||||
|
||||
ret = temp->Lock (temp, DSLF_WRITE, (void**)&dst, &pitch);
|
||||
@@ -266,13 +273,13 @@ gdk_cursor_new_for_display (GdkDisplay *display,GdkCursorType cursor_type)
|
||||
gint bit = x-mx + (y-my) * p;
|
||||
gint mbit = x + y * mp;
|
||||
|
||||
__u32 color = (x-mx < 0 || y-my < 0 ||
|
||||
u32 color = (x-mx < 0 || y-my < 0 ||
|
||||
x-mx >= stock_cursors[cursor_type].width ||
|
||||
y-my >= stock_cursors[cursor_type].height)
|
||||
? 0x00FFFFFF : (src[bit/8] & (1 << bit%8) ? 0 : 0x00FFFFFF);
|
||||
|
||||
__u8 a = color ? 0xE0 : 0xFF;
|
||||
__u32 alpha = mask[mbit/8] & (1 << mbit%8) ? (a << 24) : 0;
|
||||
u8 a = color ? 0xE0 : 0xFF;
|
||||
u32 alpha = mask[mbit/8] & (1 << mbit%8) ? (a << 24) : 0;
|
||||
|
||||
dst[x + y*pitch] = alpha | color;
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ gdk_directfb_draw_arc (GdkDrawable *drawable,
|
||||
gint angle1,
|
||||
gint angle2)
|
||||
{
|
||||
WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
|
||||
WARN_UNIMPLEMENTED (G_STRLOC);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -560,7 +560,7 @@ gdk_directfb_draw_text (GdkDrawable *drawable,
|
||||
const gchar *text,
|
||||
gint text_length)
|
||||
{
|
||||
WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
|
||||
WARN_UNIMPLEMENTED (G_STRLOC);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -572,7 +572,7 @@ gdk_directfb_draw_text_wc (GdkDrawable *drawable,
|
||||
const GdkWChar *text,
|
||||
gint text_length)
|
||||
{
|
||||
WARN_UNIMPLEMENTED (G_GNUC_FUNCTION);
|
||||
WARN_UNIMPLEMENTED (G_STRLOC);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -151,7 +151,7 @@ gdk_image_new_bitmap (GdkVisual *visual,
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_image_new_bitmap: %dx%d\n", w, h));
|
||||
|
||||
g_message ("not fully implemented %s", G_GNUC_FUNCTION);
|
||||
g_message ("not fully implemented %s", G_STRLOC);
|
||||
|
||||
image->bpl = (w + 7) / 8;
|
||||
image->mem = g_malloc (image->bpl * h);
|
||||
@@ -209,7 +209,7 @@ _gdk_image_new_for_depth (GdkScreen *screen,
|
||||
format = DSPF_ARGB;
|
||||
break;
|
||||
default:
|
||||
g_message ("unimplemented %s for depth %d", G_GNUC_FUNCTION, depth);
|
||||
g_message ("unimplemented %s for depth %d", G_STRLOC, depth);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ gboolean
|
||||
gdk_device_set_mode (GdkDevice *device,
|
||||
GdkInputMode mode)
|
||||
{
|
||||
g_message ("unimplemented %s", G_GNUC_FUNCTION);
|
||||
g_message ("unimplemented %s", G_STRLOC);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ gdk_input_set_extension_events (GdkWindow *window,
|
||||
gint mask,
|
||||
GdkExtensionMode mode)
|
||||
{
|
||||
g_message ("unimplemented %s", G_GNUC_FUNCTION);
|
||||
g_message ("unimplemented %s", G_STRLOC);
|
||||
}
|
||||
|
||||
GList *
|
||||
|
||||
@@ -172,7 +172,7 @@ gdk_pixmap_new (GdkDrawable *drawable,
|
||||
format = DSPF_RGB32;
|
||||
break;
|
||||
default:
|
||||
g_message ("unimplemented %s for depth %d", G_GNUC_FUNCTION, depth);
|
||||
g_message ("unimplemented %s for depth %d", G_STRLOC, depth);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2411,7 +2411,7 @@ gdk_window_set_functions (GdkWindow *window,
|
||||
return;
|
||||
|
||||
/* N/A */
|
||||
g_message("unimplemented %s", G_GNUC_FUNCTION);
|
||||
g_message("unimplemented %s", G_STRLOC);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2444,7 +2444,7 @@ gdk_window_set_static_gravities (GdkWindow *window,
|
||||
return FALSE;
|
||||
|
||||
/* N/A */
|
||||
g_message("unimplemented %s", G_GNUC_FUNCTION);
|
||||
g_message("unimplemented %s", G_STRLOC);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2462,7 +2462,7 @@ gdk_window_begin_resize_drag (GdkWindow *window,
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
g_message("unimplemented %s", G_GNUC_FUNCTION);
|
||||
g_message("unimplemented %s", G_STRLOC);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2477,7 +2477,7 @@ gdk_window_begin_move_drag (GdkWindow *window,
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
g_message("unimplemented %s", G_GNUC_FUNCTION);
|
||||
g_message("unimplemented %s", G_STRLOC);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2514,7 +2514,7 @@ gdk_window_get_frame_extents (GdkWindow *window,
|
||||
impl = GDK_DRAWABLE_IMPL_DIRECTFB (private->impl);
|
||||
|
||||
rect->x = impl->abs_x;
|
||||
rect->y = impl->abs_x;
|
||||
rect->y = impl->abs_y;
|
||||
rect->width = impl->width;
|
||||
rect->height = impl->height;
|
||||
}
|
||||
|
||||
+3
-1
@@ -11,7 +11,9 @@ TOP = ..\..
|
||||
|
||||
# Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
|
||||
# definition should possibly go to build/win32/module.def, too.
|
||||
WTKIT = ..\..\wtkit126
|
||||
!IFNDEF WTKIT
|
||||
WTKIT = $(TOP)\wtkit126
|
||||
!ENDIF
|
||||
|
||||
###############################################################
|
||||
|
||||
|
||||
@@ -64,6 +64,15 @@
|
||||
if (!(private->event_mask & GDK_EXPOSURE_MASK))
|
||||
return;
|
||||
|
||||
/* For some reason, we occasionally get draw requests for zero sized rects
|
||||
* at 0,0, just ignore those.
|
||||
*/
|
||||
if (rect.origin.x == 0 && rect.origin.y == 0 &&
|
||||
rect.size.width == 0 && rect.size.height == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
[self getRectsBeingDrawn:&drawn_rects count:&count];
|
||||
@@ -107,9 +116,20 @@
|
||||
|
||||
gdk_region_destroy (region);
|
||||
|
||||
if (needsInvalidateShadow)
|
||||
{
|
||||
[[self window] invalidateShadow];
|
||||
needsInvalidateShadow = NO;
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
|
||||
-(void)setNeedsInvalidateShadow:(BOOL)invalidate
|
||||
{
|
||||
needsInvalidateShadow = invalidate;
|
||||
}
|
||||
|
||||
/* For information on setting up tracking rects properly, see here:
|
||||
* http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventOverview.pdf
|
||||
*/
|
||||
@@ -132,7 +152,7 @@
|
||||
* NSPointInRect ([[self window] convertScreenToBase:[NSEvent mouseLocation]], rect)
|
||||
*/
|
||||
|
||||
rect = NSMakeRect (0, 0, impl->width, impl->height);
|
||||
rect = [self bounds];
|
||||
trackingRect = [self addTrackingRect:rect
|
||||
owner:self
|
||||
userData:nil
|
||||
@@ -156,10 +176,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setBounds:(NSRect)bounds
|
||||
-(void)setFrame:(NSRect)frame
|
||||
{
|
||||
[super setBounds:bounds];
|
||||
[self updateTrackingRect];
|
||||
[super setFrame:frame];
|
||||
|
||||
if ([self window])
|
||||
[self updateTrackingRect];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -24,10 +24,12 @@
|
||||
@interface GdkQuartzView : NSView {
|
||||
GdkWindow *gdk_window;
|
||||
NSTrackingRectTag trackingRect;
|
||||
BOOL needsInvalidateShadow;
|
||||
}
|
||||
|
||||
-(void)setGdkWindow:(GdkWindow *)window;
|
||||
-(GdkWindow *)gdkWindow;
|
||||
-(void)setNeedsInvalidateShadow:(BOOL)invalidate;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -79,9 +79,18 @@
|
||||
|
||||
-(void)windowDidBecomeMain:(NSNotification *)aNotification
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
|
||||
if (![self isVisible])
|
||||
{
|
||||
/* Note: This is a hack needed because for unknown reasons, hidden
|
||||
* windows get shown when clicking the dock icon when the application
|
||||
* is not already active.
|
||||
*/
|
||||
[self orderOut:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
window = [[self contentView] gdkWindow];
|
||||
_gdk_quartz_window_did_become_main (window);
|
||||
}
|
||||
|
||||
@@ -136,6 +145,14 @@
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
GdkEvent *event;
|
||||
|
||||
/* Ignore new position during showing/hiding the window, otherwise we
|
||||
* would get the off-screen position that is used for hidden windows to
|
||||
* get reliable MouseEntered events when showing them again. See comments
|
||||
* in show() and hide().
|
||||
*/
|
||||
if (inShowOrHide)
|
||||
return;
|
||||
|
||||
private->x = content_rect.origin.x;
|
||||
private->y = _gdk_quartz_window_get_inverted_screen_y (content_rect.origin.y + content_rect.size.height);
|
||||
|
||||
@@ -161,7 +178,7 @@
|
||||
impl->width = content_rect.size.width;
|
||||
impl->height = content_rect.size.height;
|
||||
|
||||
[[self contentView] setBounds:NSMakeRect (0, 0, impl->width, impl->height)];
|
||||
[[self contentView] setFrame:NSMakeRect (0, 0, impl->width, impl->height)];
|
||||
|
||||
/* Synthesize a configure event */
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
@@ -257,6 +274,85 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)showAndMakeKey:(BOOL)makeKey
|
||||
{
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
gboolean was_hidden;
|
||||
int requested_x = 0, requested_y = 0;
|
||||
|
||||
inShowOrHide = YES;
|
||||
was_hidden = FALSE;
|
||||
|
||||
if (!GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
NSRect content_rect;
|
||||
NSRect frame_rect;
|
||||
|
||||
was_hidden = TRUE;
|
||||
|
||||
/* We move the window in place if it's not mapped. See comment in
|
||||
* hide().
|
||||
*/
|
||||
content_rect =
|
||||
NSMakeRect (private->x,
|
||||
_gdk_quartz_window_get_inverted_screen_y (private->y) - impl->height,
|
||||
impl->width, impl->height);
|
||||
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
|
||||
[impl->toplevel setFrame:frame_rect display:NO];
|
||||
|
||||
requested_x = frame_rect.origin.x;
|
||||
requested_y = frame_rect.origin.y;
|
||||
}
|
||||
|
||||
if (makeKey)
|
||||
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
|
||||
else
|
||||
[impl->toplevel orderFront:nil];
|
||||
|
||||
inShowOrHide = NO;
|
||||
|
||||
/* When the window manager didn't allow our request, update the position
|
||||
* to what it really ended up as.
|
||||
*/
|
||||
if (was_hidden)
|
||||
{
|
||||
NSRect frame_rect;
|
||||
|
||||
frame_rect = [impl->toplevel frame];
|
||||
if (requested_x != frame_rect.origin.x || requested_y != frame_rect.origin.y)
|
||||
{
|
||||
[self windowDidMove:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)hide
|
||||
{
|
||||
GdkWindow *window = [[self contentView] gdkWindow];
|
||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
NSRect content_rect;
|
||||
NSRect frame_rect;
|
||||
|
||||
inShowOrHide = YES;
|
||||
|
||||
/* We move the window away when hiding, to make it possible to move it in
|
||||
* place when showing to get reliable tracking rect events (which are used
|
||||
* to generate crossing events). We have to do this, probably a bug in
|
||||
* quartz.
|
||||
*/
|
||||
content_rect = NSMakeRect (-500 - impl->width, -500 - impl->height,
|
||||
impl->width, impl->height);
|
||||
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
|
||||
[impl->toplevel setFrame:frame_rect display:NO];
|
||||
|
||||
[impl->toplevel orderOut:nil];
|
||||
|
||||
inShowOrHide = NO;
|
||||
}
|
||||
|
||||
- (BOOL)trackManualMove
|
||||
{
|
||||
NSPoint currentLocation;
|
||||
@@ -301,9 +397,11 @@
|
||||
float dx, dy;
|
||||
NSSize min_size;
|
||||
|
||||
if (!inManualResize)
|
||||
if (!inManualResize || inTrackManualResize)
|
||||
return NO;
|
||||
|
||||
inTrackManualResize = YES;
|
||||
|
||||
currentLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
currentLocation.x -= initialResizeFrame.origin.x;
|
||||
currentLocation.y -= initialResizeFrame.origin.y;
|
||||
@@ -332,6 +430,12 @@
|
||||
|
||||
[self setFrame:newFrame display:YES];
|
||||
|
||||
/* Let the resizing be handled by GTK+. */
|
||||
if (g_main_context_pending (NULL))
|
||||
g_main_context_iteration (NULL, FALSE);
|
||||
|
||||
inTrackManualResize = NO;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,13 @@
|
||||
#include <glib.h>
|
||||
|
||||
@interface GdkQuartzWindow : NSWindow {
|
||||
BOOL inMove;
|
||||
BOOL inMove;
|
||||
BOOL inShowOrHide;
|
||||
|
||||
/* Manually triggered move/resize (not by the window manager) */
|
||||
BOOL inManualMove;
|
||||
BOOL inManualResize;
|
||||
BOOL inTrackManualResize;
|
||||
NSPoint initialMoveLocation;
|
||||
NSPoint initialResizeLocation;
|
||||
NSRect initialResizeFrame;
|
||||
@@ -38,6 +40,8 @@
|
||||
-(BOOL)trackManualMove;
|
||||
-(void)beginManualResize;
|
||||
-(BOOL)trackManualResize;
|
||||
-(void)showAndMakeKey:(BOOL)makeKey;
|
||||
-(void)hide;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -137,9 +137,7 @@ gdk_colormap_free_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint ncolors)
|
||||
{
|
||||
/* This function shouldn't do anything since
|
||||
* colors are neve allocated.
|
||||
*/
|
||||
/* This function shouldn't do anything since colors are never allocated. */
|
||||
}
|
||||
|
||||
gint
|
||||
@@ -151,18 +149,28 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
|
||||
gboolean *success)
|
||||
{
|
||||
int i;
|
||||
int alpha;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_COLORMAP (colormap), ncolors);
|
||||
g_return_val_if_fail (colors != NULL, ncolors);
|
||||
g_return_val_if_fail (success != NULL, ncolors);
|
||||
|
||||
if (gdk_colormap_get_visual (colormap)->depth == 32)
|
||||
alpha = 0xff;
|
||||
else
|
||||
alpha = 0;
|
||||
|
||||
for (i = 0; i < ncolors; i++)
|
||||
{
|
||||
colors[i].pixel = ((colors[i].red >> 8) & 0xff) << 16 |
|
||||
((colors[i].green >> 8) & 0xff) << 8 |
|
||||
((colors[i].blue >> 8) & 0xff);
|
||||
colors[i].pixel = alpha << 24 |
|
||||
((colors[i].red >> 8) & 0xff) << 16 |
|
||||
((colors[i].green >> 8) & 0xff) << 8 |
|
||||
((colors[i].blue >> 8) & 0xff);
|
||||
}
|
||||
|
||||
if (success)
|
||||
*success = TRUE;
|
||||
*success = TRUE;
|
||||
|
||||
return ncolors;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -687,14 +687,8 @@ gdk_quartz_drawable_get_context (GdkDrawable *drawable,
|
||||
*/
|
||||
if (window_impl->in_paint_rect_count == 0)
|
||||
{
|
||||
window_impl->pool = [[NSAutoreleasePool alloc] init];
|
||||
if (![window_impl->view lockFocusIfCanDraw])
|
||||
{
|
||||
[window_impl->pool release];
|
||||
window_impl->pool = NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cg_context = [[NSGraphicsContext currentContext] graphicsPort];
|
||||
@@ -767,15 +761,7 @@ gdk_quartz_drawable_release_context (GdkDrawable *drawable,
|
||||
|
||||
/* See comment in gdk_quartz_drawable_get_context(). */
|
||||
if (window_impl->in_paint_rect_count == 0)
|
||||
{
|
||||
[window_impl->view unlockFocus];
|
||||
|
||||
if (window_impl->pool)
|
||||
{
|
||||
[window_impl->pool release];
|
||||
window_impl->pool = NULL;
|
||||
}
|
||||
}
|
||||
[window_impl->view unlockFocus];
|
||||
}
|
||||
else if (GDK_IS_PIXMAP_IMPL_QUARTZ (drawable))
|
||||
CGContextRelease (cg_context);
|
||||
|
||||
@@ -23,6 +23,30 @@ static GPollFD *pipe_pollfd;
|
||||
static guint n_pollfds;
|
||||
static CFRunLoopSourceRef select_main_thread_source;
|
||||
static CFRunLoopRef main_thread_run_loop;
|
||||
static NSAutoreleasePool *autorelease_pool;
|
||||
|
||||
gboolean
|
||||
_gdk_quartz_event_loop_check_pending (void)
|
||||
{
|
||||
return current_event != NULL;
|
||||
}
|
||||
|
||||
NSEvent*
|
||||
_gdk_quartz_event_loop_get_pending (void)
|
||||
{
|
||||
NSEvent *event;
|
||||
|
||||
event = current_event;
|
||||
current_event = NULL;
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_event_loop_release_event (NSEvent *event)
|
||||
{
|
||||
[event release];
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_event_prepare (GSource *source,
|
||||
@@ -30,9 +54,9 @@ gdk_event_prepare (GSource *source,
|
||||
{
|
||||
NSEvent *event;
|
||||
gboolean retval;
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
*timeout = -1;
|
||||
|
||||
event = [NSApp nextEventMatchingMask: NSAnyEventMask
|
||||
@@ -43,7 +67,7 @@ gdk_event_prepare (GSource *source,
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
event != NULL);
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -51,13 +75,23 @@ gdk_event_prepare (GSource *source,
|
||||
static gboolean
|
||||
gdk_event_check (GSource *source)
|
||||
{
|
||||
gboolean retval;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
if (autorelease_pool)
|
||||
[autorelease_pool release];
|
||||
autorelease_pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
if (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
current_event)
|
||||
return TRUE;
|
||||
_gdk_quartz_event_loop_check_pending ())
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = FALSE;
|
||||
|
||||
/* FIXME: We should maybe try to fetch an event again here */
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return FALSE;
|
||||
return retval;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -67,7 +101,7 @@ gdk_event_dispatch (GSource *source,
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
_gdk_events_queue (_gdk_display);
|
||||
|
||||
@@ -81,7 +115,7 @@ gdk_event_dispatch (GSource *source,
|
||||
gdk_event_free (event);
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -105,7 +139,7 @@ got_fd_activity (void *info)
|
||||
timestamp: 0
|
||||
windowNumber: 0
|
||||
context: nil
|
||||
subtype: 0
|
||||
subtype: GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
|
||||
data1: 0
|
||||
data2: 0];
|
||||
|
||||
@@ -164,8 +198,6 @@ poll_func (GPollFD *ufds, guint nfds, gint timeout_)
|
||||
int n_active = 0;
|
||||
int i;
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
if (nfds > 1)
|
||||
{
|
||||
if (!select_thread) {
|
||||
@@ -221,7 +253,8 @@ poll_func (GPollFD *ufds, guint nfds, gint timeout_)
|
||||
|
||||
if (event)
|
||||
{
|
||||
if ([event type] == NSApplicationDefined)
|
||||
if ([event type] == NSApplicationDefined &&
|
||||
[event subtype] == GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP)
|
||||
{
|
||||
pthread_mutex_lock (&pollfd_mutex);
|
||||
|
||||
@@ -264,18 +297,11 @@ poll_func (GPollFD *ufds, guint nfds, gint timeout_)
|
||||
{
|
||||
ufds[0].revents = G_IO_IN;
|
||||
|
||||
/* FIXME: We can't assert here, but we might need to have a
|
||||
* queue for events instead.
|
||||
*/
|
||||
/*g_assert (current_event == NULL);*/
|
||||
|
||||
current_event = [event retain];
|
||||
|
||||
n_active ++;
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
return n_active;
|
||||
}
|
||||
|
||||
@@ -295,19 +321,7 @@ _gdk_quartz_event_loop_init (void)
|
||||
|
||||
old_poll_func = g_main_context_get_poll_func (NULL);
|
||||
g_main_context_set_poll_func (NULL, poll_func);
|
||||
|
||||
}
|
||||
|
||||
NSEvent *
|
||||
_gdk_quartz_event_loop_get_current (void)
|
||||
{
|
||||
return current_event;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_event_loop_release_current (void)
|
||||
{
|
||||
[current_event release];
|
||||
current_event = NULL;
|
||||
|
||||
autorelease_pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
|
||||
+120
-10
@@ -130,7 +130,7 @@ gboolean
|
||||
gdk_events_pending (void)
|
||||
{
|
||||
return (_gdk_event_queue_find_first (_gdk_display) ||
|
||||
(_gdk_quartz_event_loop_get_current () != NULL));
|
||||
(_gdk_quartz_event_loop_check_pending ()));
|
||||
}
|
||||
|
||||
GdkEvent*
|
||||
@@ -1079,6 +1079,92 @@ find_mouse_window_for_ns_event (NSEvent *nsevent,
|
||||
return mouse_window;
|
||||
}
|
||||
|
||||
/* Trigger crossing events if necessary. This is used when showing a new
|
||||
* window, since the tracking rect API doesn't work reliably when a window
|
||||
* shows up under the mouse cursor. It's done by finding the topmost window
|
||||
* under the mouse pointer and synthesizing crossing events into that
|
||||
* window.
|
||||
*/
|
||||
void
|
||||
_gdk_quartz_events_trigger_crossing_events (gboolean defer_to_mainloop)
|
||||
{
|
||||
NSPoint point;
|
||||
gint x, y;
|
||||
gint x_toplevel, y_toplevel;
|
||||
GdkWindow *mouse_window;
|
||||
GdkWindow *toplevel;
|
||||
GdkWindowImplQuartz *impl;
|
||||
guint flags = 0;
|
||||
NSTimeInterval timestamp = 0;
|
||||
NSEvent *current_event;
|
||||
NSEvent *nsevent;
|
||||
|
||||
if (defer_to_mainloop)
|
||||
{
|
||||
nsevent = [NSEvent otherEventWithType:NSApplicationDefined
|
||||
location:NSZeroPoint
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:0
|
||||
context:nil
|
||||
subtype:GDK_QUARTZ_EVENT_SUBTYPE_FAKE_CROSSING
|
||||
data1:0
|
||||
data2:0];
|
||||
[NSApp postEvent:nsevent atStart:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
point = [NSEvent mouseLocation];
|
||||
x = point.x;
|
||||
y = _gdk_quartz_window_get_inverted_screen_y (point.y);
|
||||
|
||||
mouse_window = _gdk_quartz_window_find_child (_gdk_root, x, y);
|
||||
if (!mouse_window || mouse_window == _gdk_root)
|
||||
return;
|
||||
|
||||
toplevel = gdk_window_get_toplevel (mouse_window);
|
||||
|
||||
/* We ignore crossing within the same toplevel since that is already
|
||||
* handled elsewhere.
|
||||
*/
|
||||
if (toplevel == gdk_window_get_toplevel (current_mouse_window))
|
||||
return;
|
||||
|
||||
get_converted_window_coordinates (_gdk_root,
|
||||
x, y,
|
||||
toplevel,
|
||||
&x_toplevel, &y_toplevel);
|
||||
|
||||
get_converted_window_coordinates (_gdk_root,
|
||||
x, y,
|
||||
mouse_window,
|
||||
&x, &y);
|
||||
|
||||
/* Fix up the event to be less fake if possible. */
|
||||
current_event = [NSApp currentEvent];
|
||||
if (current_event)
|
||||
{
|
||||
flags = [current_event modifierFlags];
|
||||
timestamp = [current_event timestamp];
|
||||
}
|
||||
|
||||
if (timestamp == 0)
|
||||
timestamp = GetCurrentEventTime ();
|
||||
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (toplevel)->impl);
|
||||
nsevent = [NSEvent otherEventWithType:NSApplicationDefined
|
||||
location:NSMakePoint (x_toplevel, impl->height - y_toplevel)
|
||||
modifierFlags:flags
|
||||
timestamp:timestamp
|
||||
windowNumber:[impl->toplevel windowNumber]
|
||||
context:nil
|
||||
subtype:GDK_QUARTZ_EVENT_SUBTYPE_FAKE_CROSSING
|
||||
data1:0
|
||||
data2:0];
|
||||
|
||||
synthesize_crossing_events (mouse_window, GDK_CROSSING_NORMAL, nsevent, x, y);
|
||||
}
|
||||
|
||||
/* Synthesizes crossing events if necessary, based on the passed in
|
||||
* NSEvent. Uses NSMouseEntered and NSMouseExisted for toplevels and
|
||||
* the mouse moved/dragged events for child windows, to see if the
|
||||
@@ -1172,7 +1258,8 @@ synthesize_crossing_events_for_ns_event (NSEvent *nsevent)
|
||||
|
||||
/* If there is a window other than the root window at this
|
||||
* position, it means we didn't exit to the root window and we
|
||||
* ignore the event.
|
||||
* ignore the event. (Note that we can get NULL here when swithing
|
||||
* spaces for example.)
|
||||
*
|
||||
* FIXME: This is not enough, it doesn't catch the case where
|
||||
* we leave a GDK window to a non-GDK window that has GDK
|
||||
@@ -1180,9 +1267,12 @@ synthesize_crossing_events_for_ns_event (NSEvent *nsevent)
|
||||
*/
|
||||
mouse_window = _gdk_quartz_window_find_child (_gdk_root, x, y);
|
||||
|
||||
if (gdk_window_get_toplevel (mouse_window) ==
|
||||
if (!mouse_window ||
|
||||
gdk_window_get_toplevel (mouse_window) ==
|
||||
gdk_window_get_toplevel (current_mouse_window))
|
||||
mouse_window = _gdk_root;
|
||||
{
|
||||
mouse_window = _gdk_root;
|
||||
}
|
||||
|
||||
if (mouse_window == _gdk_root)
|
||||
synthesize_crossing_events (_gdk_root, GDK_CROSSING_NORMAL, nsevent, x, y);
|
||||
@@ -1435,6 +1525,7 @@ create_scroll_event (GdkWindow *window,
|
||||
point = [nsevent locationInWindow];
|
||||
event->scroll.x = point.x;
|
||||
event->scroll.y = point.y;
|
||||
event->scroll.state = get_keyboard_modifiers_from_ns_event (nsevent);
|
||||
convert_window_coordinates_to_root (window, event->scroll.x, event->scroll.y,
|
||||
&event->scroll.x_root,
|
||||
&event->scroll.y_root);
|
||||
@@ -1629,6 +1720,14 @@ gdk_event_translate (NSEvent *nsevent)
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle our generated "fake" crossing events. */
|
||||
if ([nsevent type] == NSApplicationDefined &&
|
||||
[nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_FAKE_CROSSING)
|
||||
{
|
||||
_gdk_quartz_events_trigger_crossing_events (FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Keep track of button state, since we don't get that information
|
||||
* for key events.
|
||||
*/
|
||||
@@ -1777,6 +1876,9 @@ gdk_event_translate (NSEvent *nsevent)
|
||||
event = create_scroll_event (window, nsevent, direction);
|
||||
append_event (event);
|
||||
dy--;
|
||||
|
||||
/* Ignore the delta for now, things get too slow when the events queue up. */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Now do x events */
|
||||
@@ -1793,6 +1895,9 @@ gdk_event_translate (NSEvent *nsevent)
|
||||
event = create_scroll_event (window, nsevent, direction);
|
||||
append_event (event);
|
||||
dx--;
|
||||
|
||||
/* Ignore the delta for now, things get too slow when the events queue up. */
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1825,14 +1930,19 @@ gdk_event_translate (NSEvent *nsevent)
|
||||
void
|
||||
_gdk_events_queue (GdkDisplay *display)
|
||||
{
|
||||
NSEvent *current_event = _gdk_quartz_event_loop_get_current ();
|
||||
NSEvent *event;
|
||||
|
||||
if (current_event)
|
||||
event = _gdk_quartz_event_loop_get_pending ();
|
||||
if (event)
|
||||
{
|
||||
if (!gdk_event_translate (current_event))
|
||||
[NSApp sendEvent:current_event];
|
||||
|
||||
_gdk_quartz_event_loop_release_current ();
|
||||
if (!gdk_event_translate (event))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
[NSApp sendEvent:event];
|
||||
GDK_THREADS_ENTER ();
|
||||
}
|
||||
|
||||
_gdk_quartz_event_loop_release_event (event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,8 @@ const static struct {
|
||||
{ 111, GDK_F12, 0 },
|
||||
{ 105, GDK_F13, 0 },
|
||||
{ 107, GDK_F14, 0 },
|
||||
{ 113, GDK_F15, 0 }
|
||||
{ 113, GDK_F15, 0 },
|
||||
{ 106, GDK_F16, 0 }
|
||||
};
|
||||
|
||||
const static struct {
|
||||
@@ -255,7 +256,15 @@ maybe_update_keymap (void)
|
||||
p[j] = GDK_ISO_Left_Tab;
|
||||
|
||||
if (!found)
|
||||
p[j] = gdk_unicode_to_keyval (uc);
|
||||
{
|
||||
guint tmp;
|
||||
|
||||
tmp = gdk_unicode_to_keyval (uc);
|
||||
if (tmp != (uc | 0x01000000))
|
||||
p[j] = tmp;
|
||||
else
|
||||
p[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +339,15 @@ maybe_update_keymap (void)
|
||||
p[j] = GDK_ISO_Left_Tab;
|
||||
|
||||
if (!found)
|
||||
p[j] = gdk_unicode_to_keyval (uc);
|
||||
{
|
||||
guint tmp;
|
||||
|
||||
tmp = gdk_unicode_to_keyval (uc);
|
||||
if (tmp != (uc | 0x01000000))
|
||||
p[j] = tmp;
|
||||
else
|
||||
p[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,8 +381,8 @@ maybe_update_keymap (void)
|
||||
{
|
||||
p = keyval_array + known_numeric_keys[i].keycode * KEYVALS_PER_KEYCODE;
|
||||
|
||||
if (p[0] == known_numeric_keys[i].normal_keyval);
|
||||
p[0] = known_numeric_keys[i].keypad_keyval;
|
||||
if (p[0] == known_numeric_keys[i].normal_keyval)
|
||||
p[0] = known_numeric_keys[i].keypad_keyval;
|
||||
}
|
||||
|
||||
if (current_layout)
|
||||
@@ -543,8 +560,8 @@ translate_keysym (guint hardware_keycode,
|
||||
if (state & GDK_LOCK_MASK)
|
||||
{
|
||||
guint upper = gdk_keyval_to_upper (tmp_keyval);
|
||||
if (upper != tmp_keyval)
|
||||
tmp_keyval = upper;
|
||||
if (upper != tmp_keyval)
|
||||
tmp_keyval = upper;
|
||||
}
|
||||
|
||||
return tmp_keyval;
|
||||
|
||||
@@ -144,8 +144,15 @@ void _gdk_quartz_window_attach_to_parent (GdkWindow *window);
|
||||
void _gdk_quartz_window_detach_from_parent (GdkWindow *window);
|
||||
void _gdk_quartz_window_did_become_main (GdkWindow *window);
|
||||
void _gdk_quartz_window_did_resign_main (GdkWindow *window);
|
||||
void _gdk_quartz_window_debug_highlight (GdkWindow *window,
|
||||
gint number);
|
||||
|
||||
/* Events */
|
||||
typedef enum {
|
||||
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP,
|
||||
GDK_QUARTZ_EVENT_SUBTYPE_FAKE_CROSSING
|
||||
} GdkQuartzEventSubType;
|
||||
|
||||
void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
|
||||
gboolean got_focus);
|
||||
GdkWindow * _gdk_quartz_events_get_mouse_window (gboolean consider_grabs);
|
||||
@@ -153,13 +160,15 @@ void _gdk_quartz_events_update_mouse_window (GdkWindow *window);
|
||||
void _gdk_quartz_events_update_cursor (GdkWindow *window);
|
||||
void _gdk_quartz_events_send_map_events (GdkWindow *window);
|
||||
GdkEventMask _gdk_quartz_events_get_current_event_mask (void);
|
||||
void _gdk_quartz_events_trigger_crossing_events(gboolean defer_to_mainloop);
|
||||
|
||||
extern GdkWindow *_gdk_quartz_keyboard_grab_window;
|
||||
extern GdkWindow *_gdk_quartz_pointer_grab_window;
|
||||
|
||||
/* Event loop */
|
||||
NSEvent * _gdk_quartz_event_loop_get_current (void);
|
||||
void _gdk_quartz_event_loop_release_current (void);
|
||||
gboolean _gdk_quartz_event_loop_check_pending (void);
|
||||
NSEvent * _gdk_quartz_event_loop_get_pending (void);
|
||||
void _gdk_quartz_event_loop_release_event (NSEvent *event);
|
||||
|
||||
/* FIXME: image */
|
||||
GdkImage *_gdk_quartz_image_copy_to_image (GdkDrawable *drawable,
|
||||
|
||||
+259
-87
@@ -32,8 +32,20 @@ static guint update_idle;
|
||||
|
||||
static GSList *main_window_stack;
|
||||
|
||||
#define FULLSCREEN_DATA "fullscreen-data"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
GdkWMDecoration decor;
|
||||
} FullscreenSavedGeometry;
|
||||
|
||||
|
||||
static void update_toplevel_order (void);
|
||||
static void clear_toplevel_order (void);
|
||||
static void clear_toplevel_order (void);
|
||||
|
||||
static FullscreenSavedGeometry *get_fullscreen_geometry (GdkWindow *window);
|
||||
|
||||
#define WINDOW_IS_TOPLEVEL(window) \
|
||||
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
||||
@@ -209,7 +221,7 @@ gdk_window_impl_quartz_begin_paint_region (GdkPaintable *paintable,
|
||||
x_offset = y_offset = 0;
|
||||
|
||||
window = GDK_WINDOW (drawable_impl->wrapper);
|
||||
while (window && ((GdkWindowObject *) window)->bg_pixmap == GDK_PARENT_RELATIVE_BG)
|
||||
while (window && bg_pixmap == GDK_PARENT_RELATIVE_BG)
|
||||
{
|
||||
/* If this window should have the same background as the parent,
|
||||
* fetch the parent. (And if the same goes for the parent, fetch
|
||||
@@ -218,6 +230,16 @@ gdk_window_impl_quartz_begin_paint_region (GdkPaintable *paintable,
|
||||
x_offset += ((GdkWindowObject *) window)->x;
|
||||
y_offset += ((GdkWindowObject *) window)->y;
|
||||
window = GDK_WINDOW (((GdkWindowObject *) window)->parent);
|
||||
bg_pixmap = ((GdkWindowObject *) window)->bg_pixmap;
|
||||
}
|
||||
|
||||
if (bg_pixmap == NULL || bg_pixmap == GDK_NO_BG || bg_pixmap == GDK_PARENT_RELATIVE_BG)
|
||||
{
|
||||
/* Parent relative background but the parent doesn't have a
|
||||
* pixmap.
|
||||
*/
|
||||
g_free (rects);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Note: There should be a CG API to draw tiled images, we might
|
||||
@@ -297,9 +319,11 @@ gdk_window_quartz_process_all_updates (void)
|
||||
{
|
||||
GSList *old_update_windows = update_windows;
|
||||
GSList *tmp_list = update_windows;
|
||||
GSList *nswindows;
|
||||
|
||||
update_idle = 0;
|
||||
update_windows = NULL;
|
||||
nswindows = NULL;
|
||||
|
||||
g_slist_foreach (old_update_windows, (GFunc) g_object_ref, NULL);
|
||||
|
||||
@@ -307,15 +331,49 @@ gdk_window_quartz_process_all_updates (void)
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
GdkWindow *window = tmp_list->data;
|
||||
GdkWindow *toplevel;
|
||||
|
||||
/* Only flush each toplevel at most once. */
|
||||
toplevel = gdk_window_get_toplevel (window);
|
||||
if (toplevel)
|
||||
{
|
||||
GdkWindowObject *private;
|
||||
GdkWindowImplQuartz *impl;
|
||||
NSWindow *nswindow;
|
||||
|
||||
private = (GdkWindowObject *) toplevel;
|
||||
impl = (GdkWindowImplQuartz *) private->impl;
|
||||
nswindow = impl->toplevel;
|
||||
|
||||
if (nswindow && ![nswindow isFlushWindowDisabled])
|
||||
{
|
||||
[nswindow disableFlushWindow];
|
||||
nswindows = g_slist_prepend (nswindows, nswindow);
|
||||
}
|
||||
}
|
||||
|
||||
gdk_window_quartz_process_updates_internal (tmp_list->data);
|
||||
|
||||
g_object_unref (tmp_list->data);
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
tmp_list = nswindows;
|
||||
while (tmp_list)
|
||||
{
|
||||
NSWindow *nswindow = tmp_list->data;
|
||||
|
||||
[nswindow enableFlushWindow];
|
||||
[nswindow flushWindow];
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
g_slist_free (old_update_windows);
|
||||
g_slist_free (nswindows);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -442,6 +500,115 @@ get_default_title (void)
|
||||
return title;
|
||||
}
|
||||
|
||||
static void
|
||||
get_ancestor_coordinates_from_child (GdkWindow *child_window,
|
||||
gint child_x,
|
||||
gint child_y,
|
||||
GdkWindow *ancestor_window,
|
||||
gint *ancestor_x,
|
||||
gint *ancestor_y)
|
||||
{
|
||||
GdkWindowObject *child_private = GDK_WINDOW_OBJECT (child_window);
|
||||
GdkWindowObject *ancestor_private = GDK_WINDOW_OBJECT (ancestor_window);
|
||||
|
||||
while (child_private != ancestor_private)
|
||||
{
|
||||
child_x += child_private->x;
|
||||
child_y += child_private->y;
|
||||
|
||||
child_private = child_private->parent;
|
||||
}
|
||||
|
||||
*ancestor_x = child_x;
|
||||
*ancestor_y = child_y;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_window_debug_highlight (GdkWindow *window, gint number)
|
||||
{
|
||||
GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
gint x, y;
|
||||
GdkWindow *toplevel;
|
||||
gint tx, ty;
|
||||
static NSWindow *debug_window[10];
|
||||
static NSRect old_rect[10];
|
||||
NSRect rect;
|
||||
NSColor *color;
|
||||
|
||||
g_return_if_fail (number >= 0 && number <= 9);
|
||||
|
||||
if (window == _gdk_root)
|
||||
return;
|
||||
|
||||
if (window == NULL)
|
||||
{
|
||||
if (debug_window[number])
|
||||
[debug_window[number] close];
|
||||
debug_window[number] = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
toplevel = gdk_window_get_toplevel (window);
|
||||
get_ancestor_coordinates_from_child (window, 0, 0, toplevel, &x, &y);
|
||||
|
||||
gdk_window_get_origin (toplevel, &tx, &ty);
|
||||
x += tx;
|
||||
y += ty;
|
||||
|
||||
rect = NSMakeRect (x,
|
||||
_gdk_quartz_window_get_inverted_screen_y (y + impl->height),
|
||||
impl->width, impl->height);
|
||||
|
||||
if (debug_window[number] && NSEqualRects (rect, old_rect[number]))
|
||||
return;
|
||||
|
||||
old_rect[number] = rect;
|
||||
|
||||
if (debug_window[number])
|
||||
[debug_window[number] close];
|
||||
|
||||
debug_window[number] = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:NSBorderlessWindowMask
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
|
||||
switch (number)
|
||||
{
|
||||
case 0:
|
||||
color = [NSColor redColor];
|
||||
break;
|
||||
case 1:
|
||||
color = [NSColor blueColor];
|
||||
break;
|
||||
case 2:
|
||||
color = [NSColor greenColor];
|
||||
break;
|
||||
case 3:
|
||||
color = [NSColor yellowColor];
|
||||
break;
|
||||
case 4:
|
||||
color = [NSColor brownColor];
|
||||
break;
|
||||
case 5:
|
||||
color = [NSColor purpleColor];
|
||||
break;
|
||||
default:
|
||||
color = [NSColor blackColor];
|
||||
break;
|
||||
}
|
||||
|
||||
[debug_window[number] setBackgroundColor:color];
|
||||
[debug_window[number] setAlphaValue:0.4];
|
||||
[debug_window[number] setOpaque:NO];
|
||||
[debug_window[number] setReleasedWhenClosed:YES];
|
||||
[debug_window[number] setIgnoresMouseEvents:YES];
|
||||
[debug_window[number] setLevel:NSFloatingWindowLevel];
|
||||
|
||||
[debug_window[number] orderFront:nil];
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
|
||||
GdkWindow *window)
|
||||
@@ -824,6 +991,7 @@ _gdk_windowing_window_init (void)
|
||||
{
|
||||
GdkWindowObject *private;
|
||||
GdkWindowImplQuartz *impl;
|
||||
GdkDrawableImplQuartz *drawable_impl;
|
||||
NSRect rect;
|
||||
|
||||
g_assert (_gdk_root == NULL);
|
||||
@@ -841,6 +1009,12 @@ _gdk_windowing_window_init (void)
|
||||
private->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */
|
||||
private->window_type = GDK_WINDOW_ROOT;
|
||||
private->depth = 24;
|
||||
|
||||
drawable_impl = GDK_DRAWABLE_IMPL_QUARTZ (private->impl);
|
||||
|
||||
drawable_impl->wrapper = GDK_DRAWABLE (private);
|
||||
drawable_impl->colormap = gdk_screen_get_system_colormap (_gdk_screen);
|
||||
g_object_ref (drawable_impl->colormap);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -851,6 +1025,7 @@ _gdk_windowing_window_destroy (GdkWindow *window,
|
||||
GdkWindowObject *private;
|
||||
GdkWindowImplQuartz *impl;
|
||||
GdkWindowObject *parent;
|
||||
GdkWindow *mouse_window;
|
||||
|
||||
private = GDK_WINDOW_OBJECT (window);
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
@@ -878,24 +1053,21 @@ _gdk_windowing_window_destroy (GdkWindow *window,
|
||||
if (window == _gdk_quartz_keyboard_grab_window)
|
||||
gdk_keyboard_ungrab (0);
|
||||
|
||||
_gdk_quartz_drawable_finish (GDK_DRAWABLE (impl));
|
||||
|
||||
mouse_window = _gdk_quartz_events_get_mouse_window (FALSE);
|
||||
if (window == mouse_window ||
|
||||
_gdk_quartz_window_is_ancestor (window, mouse_window))
|
||||
_gdk_quartz_events_update_mouse_window (_gdk_root);
|
||||
|
||||
if (!recursing && !foreign_destroy)
|
||||
{
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (window)->impl);
|
||||
GdkWindow *mouse_window;
|
||||
|
||||
mouse_window = _gdk_quartz_events_get_mouse_window (FALSE);
|
||||
if (window == mouse_window ||
|
||||
_gdk_quartz_window_is_ancestor (window, mouse_window))
|
||||
_gdk_quartz_events_update_mouse_window (_gdk_root);
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
_gdk_quartz_drawable_finish (GDK_DRAWABLE (impl));
|
||||
|
||||
if (impl->toplevel)
|
||||
[impl->toplevel close];
|
||||
else if (impl->view)
|
||||
[impl->view release];
|
||||
[impl->view removeFromSuperview];
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
@@ -947,30 +1119,16 @@ show_window_internal (GdkWindow *window,
|
||||
|
||||
if (impl->toplevel)
|
||||
{
|
||||
gboolean make_key;
|
||||
|
||||
/* Move the window into place, to guarantee that we get the
|
||||
* initial MouseEntered event.
|
||||
*/
|
||||
if (!GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
NSRect content_rect;
|
||||
NSRect frame_rect;
|
||||
make_key = (private->accept_focus && focus_on_map && raise &&
|
||||
private->window_type != GDK_WINDOW_TEMP);
|
||||
|
||||
content_rect =
|
||||
NSMakeRect (private->x,
|
||||
_gdk_quartz_window_get_inverted_screen_y (private->y) - impl->height,
|
||||
impl->width, impl->height);
|
||||
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
|
||||
[impl->toplevel setFrame:frame_rect display:NO];
|
||||
}
|
||||
|
||||
/* We should make the window not raise for !raise, but at least
|
||||
* this will keep it from getting focused in that case.
|
||||
*/
|
||||
if (private->accept_focus && focus_on_map && raise &&
|
||||
private->window_type != GDK_WINDOW_TEMP)
|
||||
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
|
||||
else
|
||||
[impl->toplevel orderFront:nil];
|
||||
[(GdkQuartzWindow*)impl->toplevel showAndMakeKey:make_key];
|
||||
clear_toplevel_order ();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -993,6 +1151,12 @@ show_window_internal (GdkWindow *window,
|
||||
if (impl->transient_for && !GDK_WINDOW_DESTROYED (impl->transient_for))
|
||||
_gdk_quartz_window_attach_to_parent (window);
|
||||
|
||||
/* Create a crossing event for windows that pop up under the mouse. Part
|
||||
* of the workarounds for problems with the tracking rect API.
|
||||
*/
|
||||
if (impl->toplevel)
|
||||
_gdk_quartz_events_trigger_crossing_events (TRUE);
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
|
||||
@@ -1016,6 +1180,7 @@ _gdk_quartz_window_detach_from_parent (GdkWindow *window)
|
||||
|
||||
parent_impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (impl->transient_for)->impl);
|
||||
[parent_impl->toplevel removeChildWindow:impl->toplevel];
|
||||
clear_toplevel_order ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1037,6 +1202,7 @@ _gdk_quartz_window_attach_to_parent (GdkWindow *window)
|
||||
|
||||
parent_impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (impl->transient_for)->impl);
|
||||
[parent_impl->toplevel addChildWindow:impl->toplevel ordered:NSWindowAbove];
|
||||
clear_toplevel_order ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1065,6 +1231,10 @@ gdk_window_hide (GdkWindow *window)
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
/* Make sure we're not stuck in fullscreen mode. */
|
||||
if (get_fullscreen_geometry (window))
|
||||
ShowMenuBar ();
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
@@ -1084,9 +1254,6 @@ gdk_window_hide (GdkWindow *window)
|
||||
|
||||
if (impl->toplevel)
|
||||
{
|
||||
NSRect content_rect;
|
||||
NSRect frame_rect;
|
||||
|
||||
/* Update main window. */
|
||||
main_window_stack = g_slist_remove (main_window_stack, window);
|
||||
if ([NSApp mainWindow] == impl->toplevel)
|
||||
@@ -1095,16 +1262,7 @@ gdk_window_hide (GdkWindow *window)
|
||||
if (impl->transient_for)
|
||||
_gdk_quartz_window_detach_from_parent (window);
|
||||
|
||||
/* Big hack in gdk_window_new() and show_window_internal()
|
||||
* continued. Move the window away when hidden so that we can
|
||||
* move it back before showing it.
|
||||
*/
|
||||
content_rect = NSMakeRect (-500 - impl->width, -500 - impl->height,
|
||||
impl->width, impl->height);
|
||||
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
|
||||
[impl->toplevel setFrame:frame_rect display:NO];
|
||||
|
||||
[impl->toplevel orderOut:nil];
|
||||
[(GdkQuartzWindow*)impl->toplevel hide];
|
||||
}
|
||||
else if (impl->view)
|
||||
{
|
||||
@@ -1145,10 +1303,10 @@ move_resize_window_internal (GdkWindow *window,
|
||||
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||
|
||||
if ((x == private->x) &&
|
||||
(y == private->y) &&
|
||||
(width == impl->width) &&
|
||||
(height == impl->height))
|
||||
if ((x == -1 || (x == private->x)) &&
|
||||
(y == -1 || (y == private->y)) &&
|
||||
(width == -1 || (width == impl->width)) &&
|
||||
(height == -1 || (height == impl->height)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1199,12 +1357,19 @@ move_resize_window_internal (GdkWindow *window,
|
||||
NSRect content_rect;
|
||||
NSRect frame_rect;
|
||||
|
||||
content_rect = NSMakeRect (private->x,
|
||||
_gdk_quartz_window_get_inverted_screen_y (private->y + impl->height),
|
||||
impl->width, impl->height);
|
||||
|
||||
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
|
||||
[impl->toplevel setFrame:frame_rect display:YES];
|
||||
/* We don't update the NSWindow while unmapped, since we move windows
|
||||
* off-screen when hiding in order for MouseEntered to be triggered
|
||||
* reliably when showing windows and they appear under the mouse.
|
||||
*/
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
content_rect = NSMakeRect (private->x,
|
||||
_gdk_quartz_window_get_inverted_screen_y (private->y + impl->height),
|
||||
impl->width, impl->height);
|
||||
|
||||
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
|
||||
[impl->toplevel setFrame:frame_rect display:YES];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2204,7 +2369,8 @@ gdk_window_focus (GdkWindow *window,
|
||||
if (private->accept_focus && private->window_type != GDK_WINDOW_TEMP)
|
||||
{
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
[impl->toplevel makeKeyWindow];
|
||||
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
|
||||
clear_toplevel_order ();
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
}
|
||||
@@ -2512,8 +2678,17 @@ gdk_window_set_decorations (GdkWindow *window,
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
|
||||
[impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
|
||||
[impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
|
||||
|
||||
[impl->toplevel setContentView:old_view];
|
||||
[impl->toplevel setFrame:rect display:YES];
|
||||
|
||||
/* Invalidate the window shadow for non-opaque views that have shadow
|
||||
* enabled, to get the shadow shape updated.
|
||||
*/
|
||||
if (![old_view isOpaque] && [impl->toplevel hasShadow])
|
||||
[(GdkQuartzView*)old_view setNeedsInvalidateShadow:YES];
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
@@ -2702,14 +2877,11 @@ gdk_window_deiconify (GdkWindow *window)
|
||||
}
|
||||
}
|
||||
|
||||
#define FULLSCREEN_DATA "fullscreen-data"
|
||||
|
||||
typedef struct
|
||||
static FullscreenSavedGeometry *
|
||||
get_fullscreen_geometry (GdkWindow *window)
|
||||
{
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
GdkWMDecoration decor;
|
||||
} FullscreenSavedGeometry;
|
||||
return g_object_get_data (G_OBJECT (window), FULLSCREEN_DATA);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_fullscreen (GdkWindow *window)
|
||||
@@ -2722,29 +2894,33 @@ gdk_window_fullscreen (GdkWindow *window)
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (WINDOW_IS_TOPLEVEL (window));
|
||||
|
||||
geometry = g_new (FullscreenSavedGeometry, 1);
|
||||
geometry = get_fullscreen_geometry (window);
|
||||
if (!geometry)
|
||||
{
|
||||
geometry = g_new (FullscreenSavedGeometry, 1);
|
||||
|
||||
geometry->x = private->x;
|
||||
geometry->y = private->y;
|
||||
geometry->width = impl->width;
|
||||
geometry->height = impl->height;
|
||||
|
||||
if (!gdk_window_get_decorations (window, &geometry->decor))
|
||||
geometry->decor = GDK_DECOR_ALL;
|
||||
geometry->x = private->x;
|
||||
geometry->y = private->y;
|
||||
geometry->width = impl->width;
|
||||
geometry->height = impl->height;
|
||||
|
||||
g_object_set_data_full (G_OBJECT (window),
|
||||
FULLSCREEN_DATA, geometry,
|
||||
g_free);
|
||||
if (!gdk_window_get_decorations (window, &geometry->decor))
|
||||
geometry->decor = GDK_DECOR_ALL;
|
||||
|
||||
g_object_set_data_full (G_OBJECT (window),
|
||||
FULLSCREEN_DATA, geometry,
|
||||
g_free);
|
||||
|
||||
gdk_window_set_decorations (window, 0);
|
||||
|
||||
frame = [[NSScreen mainScreen] frame];
|
||||
move_resize_window_internal (window,
|
||||
0, 0,
|
||||
frame.size.width, frame.size.height);
|
||||
}
|
||||
|
||||
HideMenuBar ();
|
||||
|
||||
gdk_window_set_decorations (window, 0);
|
||||
|
||||
frame = [[NSScreen mainScreen] frame];
|
||||
move_resize_window_internal (window,
|
||||
0, 0,
|
||||
frame.size.width, frame.size.height);
|
||||
|
||||
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
|
||||
}
|
||||
|
||||
@@ -2756,8 +2932,7 @@ gdk_window_unfullscreen (GdkWindow *window)
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (WINDOW_IS_TOPLEVEL (window));
|
||||
|
||||
geometry = g_object_get_data (G_OBJECT (window), FULLSCREEN_DATA);
|
||||
|
||||
geometry = get_fullscreen_geometry (window);
|
||||
if (geometry)
|
||||
{
|
||||
ShowMenuBar ();
|
||||
@@ -2867,9 +3042,6 @@ gdk_window_configure_finished (GdkWindow *window)
|
||||
void
|
||||
gdk_window_destroy_notify (GdkWindow *window)
|
||||
{
|
||||
/* FIXME: Implement. We should call this from -[GdkQuartzWindow dealloc] or
|
||||
* -[GdkQuartzView dealloc], although I suspect that currently they leak
|
||||
* anyway. */
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -54,11 +54,6 @@ struct _GdkWindowImplQuartz
|
||||
|
||||
GdkWindowTypeHint type_hint;
|
||||
|
||||
/* This is the autorelease pool which is retained
|
||||
* while the context is being held
|
||||
*/
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
NSCursor *nscursor;
|
||||
|
||||
GdkRegion *paint_clip_region;
|
||||
|
||||
@@ -851,15 +851,24 @@ enum_formats_new (void)
|
||||
|
||||
/* From MS Knowledge Base article Q130698 */
|
||||
|
||||
static HRESULT
|
||||
static gboolean
|
||||
resolve_link (HWND hWnd,
|
||||
guchar *lpszLinkName,
|
||||
wchar_t *link,
|
||||
guchar **lpszPath)
|
||||
{
|
||||
WIN32_FILE_ATTRIBUTE_DATA wfad;
|
||||
HRESULT hres;
|
||||
IShellLinkW *pslW = NULL;
|
||||
IPersistFile *ppf = NULL;
|
||||
|
||||
/* Check if the file is empty first because IShellLink::Resolve for
|
||||
* some reason succeeds with an empty file and returns an empty
|
||||
* "link target". (#524151)
|
||||
*/
|
||||
if (!GetFileAttributesExW (link, GetFileExInfoStandard, &wfad) ||
|
||||
(wfad.nFileSizeHigh == 0 && wfad.nFileSizeLow == 0))
|
||||
return FALSE;
|
||||
|
||||
/* Assume failure to start with: */
|
||||
*lpszPath = 0;
|
||||
|
||||
@@ -887,12 +896,8 @@ resolve_link (HWND hWnd,
|
||||
|
||||
if (SUCCEEDED (hres))
|
||||
{
|
||||
/* Convert the given link name string to wide character string. */
|
||||
wchar_t *wsz = g_utf8_to_utf16 (lpszLinkName, -1, NULL, NULL, NULL);
|
||||
|
||||
/* Load the file. */
|
||||
hres = ppf->lpVtbl->Load (ppf, wsz, STGM_READ);
|
||||
g_free (wsz);
|
||||
hres = ppf->lpVtbl->Load (ppf, link, STGM_READ);
|
||||
}
|
||||
|
||||
if (SUCCEEDED (hres))
|
||||
@@ -977,7 +982,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
|
||||
fileName = g_utf16_to_utf8 (wfn, -1, NULL, NULL, NULL);
|
||||
|
||||
/* Resolve shortcuts */
|
||||
if (resolve_link (msg->hwnd, fileName, &linkedFile))
|
||||
if (resolve_link (msg->hwnd, wfn, &linkedFile))
|
||||
{
|
||||
uri = g_filename_to_uri (linkedFile, NULL, NULL);
|
||||
g_free (linkedFile);
|
||||
|
||||
+176
-69
@@ -1,7 +1,7 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
* Copyright (C) 1998-2002 Tor Lillqvist
|
||||
* Copyright (C) 2007 Cody Russell
|
||||
* Copyright (C) 2007-2008 Cody Russell
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -94,6 +94,7 @@ static gboolean gdk_event_dispatch (GSource *source,
|
||||
gpointer user_data);
|
||||
|
||||
static void append_event (GdkEvent *event);
|
||||
static gboolean is_modally_blocked (GdkWindow *window);
|
||||
|
||||
/* Private variable declarations
|
||||
*/
|
||||
@@ -138,7 +139,7 @@ static HKL latin_locale = NULL;
|
||||
#endif
|
||||
|
||||
static gboolean in_ime_composition = FALSE;
|
||||
static UINT resize_timer;
|
||||
static UINT modal_timer;
|
||||
|
||||
static int debug_indent = 0;
|
||||
|
||||
@@ -1266,6 +1267,19 @@ apply_filters (GdkWindow *window,
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* On Windows, transient windows will not have their own taskbar entries.
|
||||
* Because of this, we must hide and restore groups of transients in both
|
||||
* directions. That is, all transient children must be hidden or restored
|
||||
* with this window, but if this window's transient owner also has a
|
||||
* transient owner then this window's transient owner must be hidden/restored
|
||||
* with this one. And etc, up the chain until we hit an ancestor that has no
|
||||
* transient owner.
|
||||
*
|
||||
* It would be a good idea if applications don't chain transient windows
|
||||
* together. There's a limit to how much evil GTK can try to shield you
|
||||
* from.
|
||||
*/
|
||||
static void
|
||||
show_window_recurse (GdkWindow *window, gboolean hide_window)
|
||||
{
|
||||
@@ -1288,15 +1302,61 @@ show_window_recurse (GdkWindow *window, gboolean hide_window)
|
||||
}
|
||||
}
|
||||
|
||||
if (!hide_window)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
if (!hide_window)
|
||||
{
|
||||
if (GDK_WINDOW_OBJECT (window)->state & GDK_WINDOW_STATE_ICONIFIED)
|
||||
{
|
||||
if (GDK_WINDOW_OBJECT (window)->state & GDK_WINDOW_STATE_MAXIMIZED)
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
|
||||
}
|
||||
}
|
||||
|
||||
impl->changing_state = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
do_show_window (GdkWindow *window, gboolean hide_window)
|
||||
{
|
||||
GdkWindow *tmp_window = NULL;
|
||||
GdkWindowImplWin32 *tmp_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
||||
|
||||
if (!tmp_impl->changing_state)
|
||||
{
|
||||
/* Find the top-level window in our transient chain. */
|
||||
while (tmp_impl->transient_owner != NULL)
|
||||
{
|
||||
tmp_window = tmp_impl->transient_owner;
|
||||
tmp_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (tmp_window)->impl);
|
||||
}
|
||||
|
||||
/* If we couldn't find one, use the window provided. */
|
||||
if (tmp_window == NULL)
|
||||
{
|
||||
tmp_window = window;
|
||||
}
|
||||
|
||||
/* Recursively show/hide every window in the chain. */
|
||||
if (tmp_window != window)
|
||||
{
|
||||
show_window_recurse (tmp_window, hide_window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_is_ancestor (GdkWindow *ancestor,
|
||||
GdkWindow *window)
|
||||
@@ -1725,6 +1785,9 @@ static gboolean
|
||||
doesnt_want_key (gint mask,
|
||||
MSG *msg)
|
||||
{
|
||||
GdkWindow *modal_current = _gdk_modal_current ();
|
||||
GdkWindow *window = (GdkWindow *) gdk_win32_handle_table_lookup ((GdkNativeWindow)msg->hwnd);
|
||||
|
||||
return (((msg->message == WM_KEYUP || msg->message == WM_SYSKEYUP) &&
|
||||
!(mask & GDK_KEY_RELEASE_MASK)) ||
|
||||
((msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN) &&
|
||||
@@ -1884,6 +1947,7 @@ handle_wm_paint (MSG *msg,
|
||||
if (GetUpdateRgn (msg->hwnd, hrgn, FALSE) == ERROR)
|
||||
{
|
||||
WIN32_GDI_FAILED ("GetUpdateRgn");
|
||||
DeleteObject (hrgn);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1956,6 +2020,7 @@ handle_wm_paint (MSG *msg,
|
||||
}
|
||||
}
|
||||
|
||||
DeleteObject (hrgn);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1979,7 +2044,7 @@ handle_stuff_while_moving_or_resizing (void)
|
||||
}
|
||||
|
||||
static VOID CALLBACK
|
||||
resize_timer_proc (HWND hwnd,
|
||||
modal_timer_proc (HWND hwnd,
|
||||
UINT msg,
|
||||
UINT id,
|
||||
DWORD time)
|
||||
@@ -2763,12 +2828,27 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
|
||||
case WM_MOUSEACTIVATE:
|
||||
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP
|
||||
|| !((GdkWindowObject *)window)->accept_focus)
|
||||
{
|
||||
*ret_valp = MA_NOACTIVATE;
|
||||
return_val = TRUE;
|
||||
}
|
||||
{
|
||||
GdkWindow *tmp;
|
||||
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP
|
||||
|| !((GdkWindowObject *)window)->accept_focus)
|
||||
{
|
||||
*ret_valp = MA_NOACTIVATE;
|
||||
return_val = TRUE;
|
||||
}
|
||||
|
||||
tmp = _gdk_modal_current ();
|
||||
|
||||
if (tmp != NULL)
|
||||
{
|
||||
if (gdk_window_get_toplevel (window) != tmp)
|
||||
{
|
||||
*ret_valp = MA_NOACTIVATEANDEAT;
|
||||
return_val = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
@@ -2872,6 +2952,18 @@ gdk_event_translate (MSG *msg,
|
||||
return_val = TRUE;
|
||||
break;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
|
||||
switch (msg->wParam)
|
||||
{
|
||||
case SC_MINIMIZE:
|
||||
case SC_RESTORE:
|
||||
do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print (" %s %dx%d",
|
||||
@@ -2895,6 +2987,7 @@ gdk_event_translate (MSG *msg,
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_WITHDRAWN,
|
||||
GDK_WINDOW_STATE_ICONIFIED);
|
||||
do_show_window (window, TRUE);
|
||||
}
|
||||
else if ((msg->wParam == SIZE_RESTORED ||
|
||||
msg->wParam == SIZE_MAXIMIZED) &&
|
||||
@@ -2907,16 +3000,25 @@ gdk_event_translate (MSG *msg,
|
||||
handle_configure_event (msg, window);
|
||||
|
||||
if (msg->wParam == SIZE_RESTORED)
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_ICONIFIED |
|
||||
GDK_WINDOW_STATE_MAXIMIZED |
|
||||
withdrawn_bit,
|
||||
0);
|
||||
{
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_ICONIFIED |
|
||||
GDK_WINDOW_STATE_MAXIMIZED |
|
||||
withdrawn_bit,
|
||||
0);
|
||||
|
||||
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TEMP && !GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
do_show_window (window, FALSE);
|
||||
}
|
||||
}
|
||||
else if (msg->wParam == SIZE_MAXIMIZED)
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_ICONIFIED |
|
||||
withdrawn_bit,
|
||||
GDK_WINDOW_STATE_MAXIMIZED);
|
||||
{
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_ICONIFIED |
|
||||
withdrawn_bit,
|
||||
GDK_WINDOW_STATE_MAXIMIZED);
|
||||
}
|
||||
|
||||
if (((GdkWindowObject *) window)->resize_count > 1)
|
||||
((GdkWindowObject *) window)->resize_count -= 1;
|
||||
@@ -2930,12 +3032,22 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
case WM_ENTERSIZEMOVE:
|
||||
_sizemove_in_progress = TRUE;
|
||||
resize_timer = SetTimer (NULL, 0, 20, resize_timer_proc);
|
||||
modal_timer = SetTimer (NULL, 0, 20, modal_timer_proc);
|
||||
break;
|
||||
|
||||
case WM_EXITSIZEMOVE:
|
||||
_sizemove_in_progress = FALSE;
|
||||
KillTimer (NULL, resize_timer);
|
||||
KillTimer (NULL, modal_timer);
|
||||
break;
|
||||
|
||||
case WM_ENTERMENULOOP:
|
||||
_sizemove_in_progress = TRUE;
|
||||
modal_timer = SetTimer (NULL, 0, 20, modal_timer_proc);
|
||||
break;
|
||||
|
||||
case WM_EXITMENULOOP:
|
||||
_sizemove_in_progress = FALSE;
|
||||
KillTimer (NULL, modal_timer);
|
||||
break;
|
||||
|
||||
case WM_WINDOWPOSCHANGED :
|
||||
@@ -3172,6 +3284,7 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*ret_valp = TRUE;
|
||||
return_val = TRUE;
|
||||
GDK_NOTE (EVENTS, g_print (" (handled ASPECT: %s)",
|
||||
@@ -3305,7 +3418,10 @@ gdk_event_translate (MSG *msg,
|
||||
append_event (event);
|
||||
}
|
||||
else
|
||||
return_val = TRUE;
|
||||
{
|
||||
return_val = TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_RENDERFORMAT:
|
||||
@@ -3340,7 +3456,9 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
/* Now the clipboard owner should have rendered */
|
||||
if (!_delayed_rendering_data)
|
||||
GDK_NOTE (EVENTS, g_print (" (no _delayed_rendering_data?)"));
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_print (" (no _delayed_rendering_data?)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (msg->wParam == CF_DIB)
|
||||
@@ -3354,6 +3472,7 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The requestor is holding the clipboard, no
|
||||
* OpenClipboard() is required/possible
|
||||
*/
|
||||
@@ -3363,47 +3482,20 @@ gdk_event_translate (MSG *msg,
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_ACTIVATE: {
|
||||
/*
|
||||
* On Windows, transient windows will not have their own taskbar entries.
|
||||
* Because of this, we must hide and restore groups of transients in both
|
||||
* directions. That is, all transient children must be hidden or restored
|
||||
* with this window, but if this window's transient owner also has a
|
||||
* transient owner then this window's transient owner must be hidden/restored
|
||||
* with this one. And etc, up the chain until we hit an ancestor that has no
|
||||
* transient owner.
|
||||
*
|
||||
* It would be a good idea if applications don't chain transient windows
|
||||
* together. There's a limit to how much evil GTK can try to shield you
|
||||
* from.
|
||||
*/
|
||||
GdkWindow *tmp_window = NULL;
|
||||
GdkWindowImplWin32 *tmp_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
|
||||
case WM_ACTIVATE:
|
||||
|
||||
while (tmp_impl->transient_owner != NULL)
|
||||
/* We handle mouse clicks for modally-blocked windows under WM_MOUSEACTIVATE,
|
||||
* but we still need to deal with alt-tab, or with SetActiveWindow() type
|
||||
* situations. */
|
||||
if (is_modally_blocked (window) && msg->wParam == WA_ACTIVE)
|
||||
{
|
||||
tmp_window = tmp_impl->transient_owner;
|
||||
tmp_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (tmp_window)->impl);
|
||||
GdkWindow *modal_current = _gdk_modal_current ();
|
||||
SetActiveWindow (GDK_WINDOW_HWND (modal_current));
|
||||
*ret_valp = 0;
|
||||
return_val = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (tmp_window == NULL)
|
||||
tmp_window = window;
|
||||
|
||||
if (LOWORD (msg->wParam) == WA_INACTIVE && HIWORD (msg->wParam))
|
||||
{
|
||||
if (!tmp_impl->changing_state)
|
||||
{
|
||||
show_window_recurse (tmp_window, TRUE);
|
||||
}
|
||||
}
|
||||
else if (LOWORD (msg->wParam) == WA_ACTIVE && HIWORD (msg->wParam))
|
||||
{
|
||||
if (!tmp_impl->changing_state)
|
||||
{
|
||||
show_window_recurse (tmp_window, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Bring any tablet contexts to the top of the overlap order when
|
||||
* one of our windows is activated.
|
||||
* NOTE: It doesn't seem to work well if it is done in WM_ACTIVATEAPP
|
||||
@@ -3412,7 +3504,7 @@ gdk_event_translate (MSG *msg,
|
||||
if (LOWORD(msg->wParam) != WA_INACTIVE)
|
||||
_gdk_input_set_tablet_active ();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Handle WINTAB events here, as we know that gdkinput.c will
|
||||
* use the fixed WT_DEFBASE as lcMsgBase, and we thus can use the
|
||||
@@ -3439,10 +3531,12 @@ gdk_event_translate (MSG *msg,
|
||||
event = gdk_event_new (GDK_NOTHING);
|
||||
event->any.window = window;
|
||||
g_object_ref (window);
|
||||
|
||||
if (_gdk_input_other_event (event, msg, window))
|
||||
append_event (event);
|
||||
else
|
||||
gdk_event_free (event);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3500,11 +3594,15 @@ gdk_event_check (GSource *source)
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
if (event_poll_fd.revents & G_IO_IN)
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
(modal_win32_dialog == NULL &&
|
||||
PeekMessageW (&msg, NULL, 0, 0, PM_NOREMOVE)));
|
||||
{
|
||||
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
|
||||
(modal_win32_dialog == NULL &&
|
||||
PeekMessageW (&msg, NULL, 0, 0, PM_NOREMOVE)));
|
||||
}
|
||||
else
|
||||
retval = FALSE;
|
||||
{
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
@@ -3542,6 +3640,13 @@ gdk_win32_set_modal_dialog_libgtk_only (HWND window)
|
||||
modal_win32_dialog = window;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_modally_blocked (GdkWindow *window)
|
||||
{
|
||||
GdkWindow *modal_current = _gdk_modal_current ();
|
||||
return modal_current != NULL ? gdk_window_get_toplevel (window) != modal_current : FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
check_for_too_much_data (GdkEvent *event)
|
||||
{
|
||||
@@ -3549,7 +3654,9 @@ check_for_too_much_data (GdkEvent *event)
|
||||
event->client.data.l[2] ||
|
||||
event->client.data.l[3] ||
|
||||
event->client.data.l[4])
|
||||
g_warning ("Only four bytes of data are passed in client messages on Win32\n");
|
||||
{
|
||||
g_warning ("Only four bytes of data are passed in client messages on Win32\n");
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
||||
+22
-10
@@ -63,6 +63,7 @@ static GdkEventMask x_grab_mask;
|
||||
static gboolean x_grab_owner_events;
|
||||
|
||||
typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c);
|
||||
typedef UINT (WINAPI *t_WTInfoW) (UINT a, UINT b, LPVOID c);
|
||||
typedef BOOL (WINAPI *t_WTEnable) (HCTX a, BOOL b);
|
||||
typedef HCTX (WINAPI *t_WTOpenA) (HWND a, LPLOGCONTEXTA b, BOOL c);
|
||||
typedef BOOL (WINAPI *t_WTOverlap) (HCTX a, BOOL b);
|
||||
@@ -70,6 +71,7 @@ typedef BOOL (WINAPI *t_WTPacket) (HCTX a, UINT b, LPVOID c);
|
||||
typedef int (WINAPI *t_WTQueueSizeSet) (HCTX a, int b);
|
||||
|
||||
static t_WTInfoA p_WTInfoA;
|
||||
static t_WTInfoW p_WTInfoW;
|
||||
static t_WTEnable p_WTEnable;
|
||||
static t_WTOpenA p_WTOpenA;
|
||||
static t_WTOverlap p_WTOverlap;
|
||||
@@ -334,7 +336,8 @@ _gdk_input_wintab_init_check (void)
|
||||
AXIS axis_x, axis_y, axis_npressure, axis_or[3];
|
||||
int i, k;
|
||||
int devix, cursorix;
|
||||
char devname[100], csrname[100];
|
||||
wchar_t devname[100], csrname[100];
|
||||
gchar *devname_utf8, *csrname_utf8;
|
||||
BOOL defcontext_done;
|
||||
HMODULE wintab32;
|
||||
|
||||
@@ -353,6 +356,8 @@ _gdk_input_wintab_init_check (void)
|
||||
|
||||
if ((p_WTInfoA = (t_WTInfoA) GetProcAddress (wintab32, "WTInfoA")) == NULL)
|
||||
return;
|
||||
if ((p_WTInfoW = (t_WTInfoW) GetProcAddress (wintab32, "WTInfoW")) == NULL)
|
||||
return;
|
||||
if ((p_WTEnable = (t_WTEnable) GetProcAddress (wintab32, "WTEnable")) == NULL)
|
||||
return;
|
||||
if ((p_WTOpenA = (t_WTOpenA) GetProcAddress (wintab32, "WTOpenA")) == NULL)
|
||||
@@ -395,13 +400,17 @@ _gdk_input_wintab_init_check (void)
|
||||
{
|
||||
LOGCONTEXT lc;
|
||||
|
||||
/* We open the Wintab device (hmm, what if there are several?) as a
|
||||
* system pointing device, i.e. it controls the normal Windows
|
||||
/* We open the Wintab device (hmm, what if there are several, or
|
||||
* can there even be several, probably not?) as a system
|
||||
* pointing device, i.e. it controls the normal Windows
|
||||
* cursor. This seems much more natural.
|
||||
*/
|
||||
|
||||
(*p_WTInfoA) (WTI_DEVICES + devix, DVC_NAME, devname);
|
||||
|
||||
(*p_WTInfoW) (WTI_DEVICES + devix, DVC_NAME, devname);
|
||||
devname_utf8 = g_utf16_to_utf8 (devname, -1, NULL, NULL, NULL);
|
||||
#ifdef DEBUG_WINTAB
|
||||
GDK_NOTE (INPUT, (g_print("Device %d: %s\n", devix, devname_utf8)));
|
||||
#endif
|
||||
(*p_WTInfoA) (WTI_DEVICES + devix, DVC_NCSRTYPES, &ncsrtypes);
|
||||
(*p_WTInfoA) (WTI_DEVICES + devix, DVC_FIRSTCSR, &firstcsr);
|
||||
(*p_WTInfoA) (WTI_DEVICES + devix, DVC_HARDWARE, &hardware);
|
||||
@@ -433,7 +442,7 @@ _gdk_input_wintab_init_check (void)
|
||||
lc.lcOptions |= CXO_MESSAGES;
|
||||
lc.lcStatus = 0;
|
||||
lc.lcMsgBase = WT_DEFBASE;
|
||||
lc.lcPktRate = 50;
|
||||
lc.lcPktRate = 0;
|
||||
lc.lcPktData = PACKETDATA;
|
||||
lc.lcPktMode = PACKETMODE;
|
||||
lc.lcMoveMask = PACKETDATA;
|
||||
@@ -484,7 +493,7 @@ _gdk_input_wintab_init_check (void)
|
||||
for (cursorix = firstcsr; cursorix < firstcsr + ncsrtypes; cursorix++)
|
||||
{
|
||||
#ifdef DEBUG_WINTAB
|
||||
GDK_NOTE (INPUT, (g_print("Cursor %d:\n", cursorix), print_cursor (cursorix)));
|
||||
GDK_NOTE (INPUT, (g_print("Cursor %d:\n", cursorix), print_cursor (cursorix)));
|
||||
#endif
|
||||
active = FALSE;
|
||||
(*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_ACTIVE, &active);
|
||||
@@ -500,12 +509,14 @@ _gdk_input_wintab_init_check (void)
|
||||
* at least for Wacom, skip cursors with physid zero.
|
||||
*/
|
||||
(*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_PHYSID, &physid);
|
||||
if (strcmp (devname, "WACOM Tablet") == 0 && physid == 0)
|
||||
if (wcscmp (devname, L"WACOM Tablet") == 0 && physid == 0)
|
||||
continue;
|
||||
|
||||
gdkdev = g_object_new (GDK_TYPE_DEVICE, NULL);
|
||||
(*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_NAME, csrname);
|
||||
gdkdev->info.name = g_strconcat (devname, " ", csrname, NULL);
|
||||
(*p_WTInfoW) (WTI_CURSORS + cursorix, CSR_NAME, csrname);
|
||||
csrname_utf8 = g_utf16_to_utf8 (csrname, -1, NULL, NULL, NULL);
|
||||
gdkdev->info.name = g_strconcat (devname_utf8, " ", csrname_utf8, NULL);
|
||||
g_free (csrname_utf8);
|
||||
gdkdev->info.source = GDK_SOURCE_PEN;
|
||||
gdkdev->info.mode = GDK_MODE_SCREEN;
|
||||
gdkdev->info.has_cursor = TRUE;
|
||||
@@ -602,6 +613,7 @@ _gdk_input_wintab_init_check (void)
|
||||
_gdk_input_devices = g_list_append (_gdk_input_devices,
|
||||
gdkdev);
|
||||
}
|
||||
g_free (devname_utf8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -543,6 +543,48 @@ _gdk_win32_window_state_to_string (GdkWindowState state)
|
||||
return static_printf ("%s", buf);
|
||||
}
|
||||
|
||||
gchar *
|
||||
_gdk_win32_window_style_to_string (LONG style)
|
||||
{
|
||||
gchar buf[1000];
|
||||
gchar *bufp = buf;
|
||||
gchar *s = "";
|
||||
|
||||
buf[0] = '\0';
|
||||
|
||||
#define BIT(x) \
|
||||
if (style & WS_ ## x) \
|
||||
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
|
||||
|
||||
/* Note that many of the WS_* macros are in face several bits.
|
||||
* Handle just the individual bits here. Sort as in w32api's
|
||||
* winuser.h.
|
||||
*/
|
||||
BIT (BORDER);
|
||||
BIT (CHILD);
|
||||
BIT (CLIPCHILDREN);
|
||||
BIT (CLIPSIBLINGS);
|
||||
BIT (DISABLED);
|
||||
BIT (DLGFRAME);
|
||||
BIT (GROUP);
|
||||
BIT (HSCROLL);
|
||||
BIT (ICONIC);
|
||||
BIT (MAXIMIZE);
|
||||
BIT (MAXIMIZEBOX);
|
||||
BIT (MINIMIZE);
|
||||
BIT (MINIMIZEBOX);
|
||||
BIT (POPUP);
|
||||
BIT (SIZEBOX);
|
||||
BIT (SYSMENU);
|
||||
BIT (TABSTOP);
|
||||
BIT (THICKFRAME);
|
||||
BIT (VISIBLE);
|
||||
BIT (VSCROLL);
|
||||
#undef BIT
|
||||
|
||||
return static_printf ("%s", buf);
|
||||
}
|
||||
|
||||
gchar *
|
||||
_gdk_win32_rop2_to_string (int rop2)
|
||||
{
|
||||
|
||||
@@ -276,6 +276,11 @@ void _gdk_wchar_text_handle (GdkFont *font,
|
||||
void *),
|
||||
void *arg);
|
||||
|
||||
void _gdk_push_modal_window (GdkWindow *window);
|
||||
void _gdk_remove_modal_window (GdkWindow *window);
|
||||
GdkWindow *_gdk_modal_current ();
|
||||
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
gchar *_gdk_win32_color_to_string (const GdkColor *color);
|
||||
void _gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
|
||||
@@ -291,6 +296,7 @@ gchar *_gdk_win32_join_style_to_string (GdkJoinStyle join_style);
|
||||
gchar *_gdk_win32_line_style_to_string (GdkLineStyle line_style);
|
||||
gchar *_gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask);
|
||||
gchar *_gdk_win32_window_state_to_string (GdkWindowState state);
|
||||
gchar *_gdk_win32_window_style_to_string (LONG style);
|
||||
gchar *_gdk_win32_drawable_description (GdkDrawable *d);
|
||||
|
||||
gchar *_gdk_win32_rop2_to_string (int rop2);
|
||||
|
||||
@@ -1028,7 +1028,7 @@ gdk_win32_selection_add_targets (GdkWindow *owner,
|
||||
gint n_targets,
|
||||
GdkAtom *targets)
|
||||
{
|
||||
HWND hwnd;
|
||||
HWND hwnd = NULL;
|
||||
guint formatid;
|
||||
gint i;
|
||||
GSList *convertable_formats, *format;
|
||||
@@ -1121,10 +1121,11 @@ gdk_win32_selection_add_targets (GdkWindow *owner,
|
||||
{
|
||||
gchar **mime_types =
|
||||
gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) format->data);
|
||||
gchar **mime_type;
|
||||
|
||||
for (; *mime_types; ++mime_types)
|
||||
for (mime_type = mime_types; *mime_type; ++mime_type)
|
||||
{
|
||||
if (!strcmp (target_name, *mime_types))
|
||||
if (!strcmp (target_name, *mime_type))
|
||||
{
|
||||
g_hash_table_replace (_format_atom_table,
|
||||
GINT_TO_POINTER (CF_DIB),
|
||||
@@ -1135,6 +1136,7 @@ gdk_win32_selection_add_targets (GdkWindow *owner,
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_strfreev(mime_types);
|
||||
}
|
||||
g_free (target_name);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ void gdk_win32_selection_add_targets (GdkWindow *owner,
|
||||
GdkAtom *targets);
|
||||
|
||||
/* For internal GTK use only */
|
||||
GdkPixbuf * gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon);
|
||||
GdkPixbuf *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon);
|
||||
HICON gdk_win32_pixbuf_to_hicon_libgtk_only (GdkPixbuf *pixbuf);
|
||||
void gdk_win32_set_modal_dialog_libgtk_only (HWND window);
|
||||
|
||||
|
||||
+194
-44
@@ -51,6 +51,7 @@ static void gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass);
|
||||
static void gdk_window_impl_win32_finalize (GObject *object);
|
||||
|
||||
static gpointer parent_class = NULL;
|
||||
static GSList *modal_window_stack = NULL;
|
||||
|
||||
static void update_style_bits (GdkWindow *window);
|
||||
static gboolean _gdk_window_get_functions (GdkWindow *window,
|
||||
@@ -154,14 +155,17 @@ gdk_window_impl_win32_finalize (GObject *object)
|
||||
{
|
||||
if (GetCursor () == window_impl->hcursor)
|
||||
SetCursor (NULL);
|
||||
|
||||
GDI_CALL (DestroyCursor, (window_impl->hcursor));
|
||||
window_impl->hcursor = NULL;
|
||||
}
|
||||
|
||||
if (window_impl->hicon_big != NULL)
|
||||
{
|
||||
GDI_CALL (DestroyIcon, (window_impl->hicon_big));
|
||||
window_impl->hicon_big = NULL;
|
||||
}
|
||||
|
||||
if (window_impl->hicon_small != NULL)
|
||||
{
|
||||
GDI_CALL (DestroyIcon, (window_impl->hicon_small));
|
||||
@@ -338,6 +342,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
|
||||
wcl.hInstance = _gdk_app_hmodule;
|
||||
wcl.hIcon = 0;
|
||||
wcl.hIconSm = 0;
|
||||
|
||||
/* initialize once! */
|
||||
if (0 == hAppIcon && 0 == hAppIconSm)
|
||||
{
|
||||
@@ -346,12 +351,16 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
|
||||
if (0 != GetModuleFileName (_gdk_app_hmodule, sLoc, MAX_PATH))
|
||||
{
|
||||
ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);
|
||||
|
||||
if (0 == hAppIcon && 0 == hAppIconSm)
|
||||
{
|
||||
if (0 != GetModuleFileName (_gdk_dll_hinstance, sLoc, MAX_PATH))
|
||||
ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);
|
||||
{
|
||||
ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == hAppIcon && 0 == hAppIconSm)
|
||||
{
|
||||
hAppIcon = LoadImage (NULL, IDI_APPLICATION, IMAGE_ICON,
|
||||
@@ -362,6 +371,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
|
||||
GetSystemMetrics (SM_CYSMICON), 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == hAppIcon)
|
||||
hAppIcon = hAppIconSm;
|
||||
else if (0 == hAppIconSm)
|
||||
@@ -844,6 +854,9 @@ _gdk_windowing_window_destroy (GdkWindow *window,
|
||||
if (private->extension_events != 0)
|
||||
_gdk_input_window_destroy (window);
|
||||
|
||||
/* Remove ourself from the modal stack */
|
||||
_gdk_remove_modal_window (window);
|
||||
|
||||
/* Remove all our transient children */
|
||||
tmp = window_impl->transient_children;
|
||||
while (tmp != NULL)
|
||||
@@ -1077,15 +1090,25 @@ show_window_internal (GdkWindow *window,
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_FULLSCREEN)
|
||||
gdk_window_fullscreen (window);
|
||||
{
|
||||
gdk_window_fullscreen (window);
|
||||
}
|
||||
else if (private->state & GDK_WINDOW_STATE_MAXIMIZED)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
||||
}
|
||||
else if (private->state & GDK_WINDOW_STATE_ICONIFIED)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
}
|
||||
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
}
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
if (raise)
|
||||
{
|
||||
@@ -1097,17 +1120,25 @@ show_window_internal (GdkWindow *window,
|
||||
GDK_WINDOW_TYPE (window) == GDK_WINDOW_DIALOG)
|
||||
{
|
||||
if (focus_on_map && private->accept_focus)
|
||||
SetForegroundWindow (GDK_WINDOW_HWND (window));
|
||||
{
|
||||
SetForegroundWindow (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
else
|
||||
SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOP,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||
{
|
||||
SetWindowPos (GDK_WINDOW_HWND (window), HWND_TOP,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||
}
|
||||
}
|
||||
else
|
||||
BringWindowToTop (GDK_WINDOW_HWND (window));
|
||||
{
|
||||
BringWindowToTop (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
}
|
||||
else if (old_active_window != GDK_WINDOW_HWND (window))
|
||||
SetActiveWindow (old_active_window);
|
||||
{
|
||||
SetActiveWindow (old_active_window);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1775,7 +1806,9 @@ get_effective_window_decorations (GdkWindow *window,
|
||||
|
||||
if (((GdkWindowObject *) window)->window_type != GDK_WINDOW_TOPLEVEL &&
|
||||
((GdkWindowObject *) window)->window_type != GDK_WINDOW_DIALOG)
|
||||
return FALSE;
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((impl->hint_flags & GDK_HINT_MIN_SIZE) &&
|
||||
(impl->hint_flags & GDK_HINT_MAX_SIZE) &&
|
||||
@@ -1783,12 +1816,17 @@ get_effective_window_decorations (GdkWindow *window,
|
||||
impl->hints.min_height == impl->hints.max_height)
|
||||
{
|
||||
*decoration = GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MAXIMIZE;
|
||||
|
||||
if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
|
||||
impl->type_hint == GDK_WINDOW_TYPE_HINT_MENU ||
|
||||
impl->type_hint == GDK_WINDOW_TYPE_HINT_TOOLBAR)
|
||||
*decoration |= GDK_DECOR_MINIMIZE;
|
||||
{
|
||||
*decoration |= GDK_DECOR_MINIMIZE;
|
||||
}
|
||||
else if (impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
|
||||
*decoration |= GDK_DECOR_MENU | GDK_DECOR_MINIMIZE;
|
||||
{
|
||||
*decoration |= GDK_DECOR_MENU | GDK_DECOR_MINIMIZE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1798,7 +1836,10 @@ get_effective_window_decorations (GdkWindow *window,
|
||||
if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
|
||||
impl->type_hint == GDK_WINDOW_TYPE_HINT_MENU ||
|
||||
impl->type_hint == GDK_WINDOW_TYPE_HINT_TOOLBAR)
|
||||
*decoration |= GDK_DECOR_MINIMIZE;
|
||||
{
|
||||
*decoration |= GDK_DECOR_MINIMIZE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@@ -1985,6 +2026,8 @@ gdk_window_set_transient_for (GdkWindow *window,
|
||||
trans_impl->transient_children = NULL;
|
||||
}
|
||||
}
|
||||
g_object_unref (G_OBJECT (window_impl->transient_owner));
|
||||
g_object_unref (G_OBJECT (window));
|
||||
|
||||
window_impl->transient_owner = NULL;
|
||||
}
|
||||
@@ -1993,8 +2036,10 @@ gdk_window_set_transient_for (GdkWindow *window,
|
||||
parent_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (parent)->impl);
|
||||
|
||||
parent_impl->transient_children = g_slist_append (parent_impl->transient_children, window);
|
||||
g_object_ref (G_OBJECT (window));
|
||||
parent_impl->num_transients++;
|
||||
window_impl->transient_owner = parent;
|
||||
g_object_ref (G_OBJECT (parent));
|
||||
}
|
||||
|
||||
/* This changes the *owner* of the window, despite the misleading
|
||||
@@ -2008,6 +2053,54 @@ gdk_window_set_transient_for (GdkWindow *window,
|
||||
WIN32_API_FAILED ("SetWindowLong");
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_push_modal_window (GdkWindow *window)
|
||||
{
|
||||
modal_window_stack = g_slist_prepend (modal_window_stack,
|
||||
window);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_remove_modal_window (GdkWindow *window)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
/* It's possible to be NULL here if someone sets the modal hint of the window
|
||||
* to FALSE before a modal window stack has ever been created. */
|
||||
if (modal_window_stack == NULL)
|
||||
return;
|
||||
|
||||
/* Find the requested window in the stack and remove it. Yeah, I realize this
|
||||
* means we're not a 'real stack', strictly speaking. Sue me. :) */
|
||||
tmp = g_slist_find (modal_window_stack, window);
|
||||
if (tmp != NULL)
|
||||
{
|
||||
modal_window_stack = g_slist_delete_link (modal_window_stack, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
_gdk_modal_current ()
|
||||
{
|
||||
if (modal_window_stack != NULL)
|
||||
{
|
||||
GSList *tmp = modal_window_stack;
|
||||
|
||||
while (tmp != NULL && !GDK_WINDOW_IS_MAPPED (tmp->data))
|
||||
{
|
||||
tmp = g_slist_next (tmp);
|
||||
}
|
||||
|
||||
return tmp != NULL ? tmp->data : NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_set_background (GdkWindow *window,
|
||||
const GdkColor *color)
|
||||
@@ -2792,14 +2885,15 @@ gdk_window_set_group (GdkWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
update_single_bit (LONG *style,
|
||||
BOOL all,
|
||||
int gdk_bit,
|
||||
int style_bit)
|
||||
update_single_bit (LONG *style,
|
||||
gboolean all,
|
||||
int gdk_bit,
|
||||
int style_bit)
|
||||
{
|
||||
/* all controls the interpretation of gdk_bit -- if all is true, gdk_bit
|
||||
indicates whether style_bit is off; if all is false, gdk bit indicate whether
|
||||
style_bit is on */
|
||||
/* all controls the interpretation of gdk_bit -- if all is TRUE,
|
||||
* gdk_bit indicates whether style_bit is off; if all is FALSE, gdk
|
||||
* bit indicate whether style_bit is on
|
||||
*/
|
||||
if ((!all && gdk_bit) || (all && !gdk_bit))
|
||||
*style |= style_bit;
|
||||
else
|
||||
@@ -2810,9 +2904,8 @@ static void
|
||||
update_style_bits (GdkWindow *window)
|
||||
{
|
||||
GdkWMDecoration decorations;
|
||||
GdkWMFunction functions;
|
||||
LONG style, exstyle;
|
||||
BOOL all;
|
||||
gboolean all;
|
||||
RECT rect, before, after;
|
||||
|
||||
style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE);
|
||||
@@ -2822,6 +2915,8 @@ update_style_bits (GdkWindow *window)
|
||||
after = before;
|
||||
AdjustWindowRectEx (&before, style, FALSE, exstyle);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("update_style_bits: style: %s", _gdk_win32_window_style_to_string (style)));
|
||||
|
||||
if (get_effective_window_decorations (window, &decorations))
|
||||
{
|
||||
all = (decorations & GDK_DECOR_ALL);
|
||||
@@ -2833,18 +2928,8 @@ update_style_bits (GdkWindow *window)
|
||||
update_single_bit (&style, all, decorations & GDK_DECOR_MAXIMIZE, WS_MAXIMIZEBOX);
|
||||
}
|
||||
|
||||
/* XXX this is actually incorrect. The menu entries should be added or removed
|
||||
from the system menu without affecting the window style. */
|
||||
if (_gdk_window_get_functions (window, &functions))
|
||||
{
|
||||
all = (functions & GDK_DECOR_ALL);
|
||||
update_single_bit (&style, all, functions & GDK_FUNC_RESIZE, WS_THICKFRAME);
|
||||
update_single_bit (&style, all, functions & GDK_FUNC_MOVE, WS_THICKFRAME | WS_SYSMENU);
|
||||
update_single_bit (&style, all, functions & GDK_FUNC_MINIMIZE, WS_MINIMIZE);
|
||||
update_single_bit (&style, all, functions & GDK_FUNC_MOVE, WS_MAXIMIZE);
|
||||
update_single_bit (&style, all, functions & GDK_FUNC_CLOSE, WS_SYSMENU);
|
||||
}
|
||||
|
||||
GDK_NOTE (MISC, g_print (" => %s\n", _gdk_win32_window_style_to_string (style)));
|
||||
|
||||
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, style);
|
||||
|
||||
AdjustWindowRectEx (&after, style, FALSE, exstyle);
|
||||
@@ -2862,6 +2947,41 @@ update_style_bits (GdkWindow *window)
|
||||
SWP_NOREPOSITION | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
static void
|
||||
update_single_system_menu_entry (HMENU hmenu,
|
||||
gboolean all,
|
||||
int gdk_bit,
|
||||
int menu_entry)
|
||||
{
|
||||
/* all controls the interpretation of gdk_bit -- if all is TRUE,
|
||||
* gdk_bit indicates whether menu entry is disabled; if all is
|
||||
* FALSE, gdk bit indicate whether menu entry is enabled
|
||||
*/
|
||||
if ((!all && gdk_bit) || (all && !gdk_bit))
|
||||
EnableMenuItem (hmenu, menu_entry, MF_BYCOMMAND | MF_ENABLED);
|
||||
else
|
||||
EnableMenuItem (hmenu, menu_entry, MF_BYCOMMAND | MF_GRAYED);
|
||||
}
|
||||
|
||||
static void
|
||||
update_system_menu (GdkWindow *window)
|
||||
{
|
||||
GdkWMFunction functions;
|
||||
BOOL all;
|
||||
|
||||
if (_gdk_window_get_functions (window, &functions))
|
||||
{
|
||||
HMENU hmenu = GetSystemMenu (GDK_WINDOW_HWND (window), FALSE);
|
||||
|
||||
all = (functions & GDK_DECOR_ALL);
|
||||
update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_RESIZE, SC_SIZE);
|
||||
update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_MOVE, SC_MOVE);
|
||||
update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_MINIMIZE, SC_MINIMIZE);
|
||||
update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_MAXIMIZE, SC_MAXIMIZE);
|
||||
update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_CLOSE, SC_CLOSE);
|
||||
}
|
||||
}
|
||||
|
||||
static GQuark
|
||||
get_decorations_quark ()
|
||||
{
|
||||
@@ -2945,7 +3065,7 @@ gdk_window_set_functions (GdkWindow *window,
|
||||
*functions_copy = functions;
|
||||
g_object_set_qdata_full (G_OBJECT (window), get_functions_quark (), functions_copy, g_free);
|
||||
|
||||
update_style_bits (window);
|
||||
update_system_menu (window);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -3313,9 +3433,11 @@ struct _FullscreenInfo
|
||||
void
|
||||
gdk_window_fullscreen (GdkWindow *window)
|
||||
{
|
||||
gint width, height;
|
||||
gint x, y, width, height;
|
||||
FullscreenInfo *fi;
|
||||
GdkWindowObject *private = (GdkWindowObject *) window;
|
||||
HMONITOR monitor;
|
||||
MONITORINFO mi;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -3327,9 +3449,22 @@ gdk_window_fullscreen (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
|
||||
|
||||
width = GetSystemMetrics (SM_CXSCREEN);
|
||||
height = GetSystemMetrics (SM_CYSCREEN);
|
||||
|
||||
monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST);
|
||||
mi.cbSize = sizeof (mi);
|
||||
if (monitor && GetMonitorInfo (monitor, &mi))
|
||||
{
|
||||
x = mi.rcMonitor.left;
|
||||
y = mi.rcMonitor.top;
|
||||
width = mi.rcMonitor.right - x;
|
||||
height = mi.rcMonitor.bottom - y;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = y = 0;
|
||||
width = GetSystemMetrics (SM_CXSCREEN);
|
||||
height = GetSystemMetrics (SM_CYSCREEN);
|
||||
}
|
||||
|
||||
/* remember for restoring */
|
||||
fi->hint_flags = impl->hint_flags;
|
||||
impl->hint_flags &= ~GDK_HINT_MAX_SIZE;
|
||||
@@ -3340,7 +3475,7 @@ gdk_window_fullscreen (GdkWindow *window)
|
||||
(fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
|
||||
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
|
||||
0, 0, width, height,
|
||||
x, y, width, height,
|
||||
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
|
||||
|
||||
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
|
||||
@@ -3449,15 +3584,30 @@ gdk_window_set_modal_hint (GdkWindow *window,
|
||||
|
||||
private = (GdkWindowObject*) window;
|
||||
|
||||
if (modal == private->modal_hint)
|
||||
return;
|
||||
|
||||
private->modal_hint = modal;
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
/* Not sure about this one.. -- Cody */
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
|
||||
modal ? HWND_TOPMOST : HWND_NOTOPMOST,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOMOVE | SWP_NOSIZE));
|
||||
#else
|
||||
|
||||
if (modal)
|
||||
{
|
||||
_gdk_push_modal_window (window);
|
||||
gdk_window_raise (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
_gdk_remove_modal_window (window);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ struct _GdkWindowImplWin32
|
||||
struct _GdkWindowImplWin32Class
|
||||
{
|
||||
GdkDrawableImplWin32Class parent_class;
|
||||
|
||||
};
|
||||
|
||||
GType _gdk_window_impl_win32_get_type (void);
|
||||
|
||||
@@ -46,7 +46,7 @@ struct _GdkColormapPrivateX11
|
||||
GdkColorInfo *info;
|
||||
time_t last_sync_time;
|
||||
|
||||
guint foreign : 1;
|
||||
gboolean foreign;
|
||||
};
|
||||
|
||||
#define GDK_COLORMAP_PRIVATE_DATA(cmap) ((GdkColormapPrivateX11 *) GDK_COLORMAP (cmap)->windowing_data)
|
||||
@@ -107,7 +107,7 @@ gdk_colormap_finalize (GObject *object)
|
||||
|
||||
gdk_colormap_remove (colormap);
|
||||
|
||||
if (!private->screen->closed)
|
||||
if (!private->screen->closed && !private->foreign)
|
||||
XFreeColormap (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap);
|
||||
|
||||
if (private->hash)
|
||||
@@ -1292,6 +1292,7 @@ gdk_x11_colormap_foreign_new (GdkVisual *visual,
|
||||
private->screen = screen;
|
||||
private->xcolormap = xcolormap;
|
||||
private->private_val = FALSE;
|
||||
private->foreign = TRUE;
|
||||
|
||||
colormap->size = visual->colormap_size;
|
||||
|
||||
|
||||
+10
-5
@@ -754,11 +754,16 @@ _gdk_device_get_history (GdkDevice *device,
|
||||
if (device_coords)
|
||||
{
|
||||
coords = _gdk_device_allocate_history (device, *n_events);
|
||||
|
||||
for (i=0; i<*n_events; i++)
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
device_coords[i].data,
|
||||
coords[i]->axes, NULL, NULL);
|
||||
|
||||
for (i = 0; i < *n_events; i++)
|
||||
{
|
||||
coords[i]->time = device_coords[i].time;
|
||||
|
||||
gdk_input_translate_coordinates (gdkdev, input_window,
|
||||
device_coords[i].data,
|
||||
coords[i]->axes, NULL, NULL);
|
||||
}
|
||||
|
||||
XFreeDeviceMotionEvents (device_coords);
|
||||
|
||||
*events = coords;
|
||||
|
||||
@@ -1661,7 +1661,7 @@ _gdk_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
{
|
||||
XkbDescRec *xkb = get_xkb (keymap_x11);
|
||||
|
||||
if (xkb->map->modmap[keycode] != 0)
|
||||
if (xkb->map->modmap && xkb->map->modmap[keycode] != 0)
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
|
||||
+61
-8
@@ -1326,6 +1326,7 @@ set_initial_hints (GdkWindow *window)
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_MAXIMIZED_HORZ");
|
||||
++i;
|
||||
toplevel->have_maxhorz = toplevel->have_maxvert = TRUE;
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_ABOVE)
|
||||
@@ -1347,6 +1348,7 @@ set_initial_hints (GdkWindow *window)
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_STICKY");
|
||||
++i;
|
||||
toplevel->have_sticky = TRUE;
|
||||
}
|
||||
|
||||
if (private->state & GDK_WINDOW_STATE_FULLSCREEN)
|
||||
@@ -1354,6 +1356,7 @@ set_initial_hints (GdkWindow *window)
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_FULLSCREEN");
|
||||
++i;
|
||||
toplevel->have_fullscreen = TRUE;
|
||||
}
|
||||
|
||||
if (private->modal_hint)
|
||||
@@ -1400,6 +1403,7 @@ set_initial_hints (GdkWindow *window)
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
|
||||
XA_CARDINAL, 32, PropModeReplace,
|
||||
(guchar*) atoms, 1);
|
||||
toplevel->on_all_desktops = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3408,6 +3412,7 @@ gdk_window_get_frame_extents (GdkWindow *window,
|
||||
Window xwindow;
|
||||
Window xparent;
|
||||
Window root;
|
||||
Window child;
|
||||
Window *children;
|
||||
guchar *data;
|
||||
Window *vroots;
|
||||
@@ -3420,6 +3425,7 @@ gdk_window_get_frame_extents (GdkWindow *window,
|
||||
gint i;
|
||||
guint ww, wh, wb, wd;
|
||||
gint wx, wy;
|
||||
gboolean got_frame_extents = FALSE;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (rect != NULL);
|
||||
@@ -3445,15 +3451,62 @@ gdk_window_get_frame_extents (GdkWindow *window,
|
||||
if (GDK_WINDOW_DESTROYED (private))
|
||||
return;
|
||||
|
||||
gdk_error_trap_push();
|
||||
|
||||
/* use NETWM_VIRTUAL_ROOTS if available */
|
||||
display = gdk_drawable_get_display (window);
|
||||
root = GDK_WINDOW_XROOTWIN (window);
|
||||
|
||||
nvroots = 0;
|
||||
vroots = NULL;
|
||||
|
||||
gdk_error_trap_push();
|
||||
|
||||
display = gdk_drawable_get_display (window);
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
|
||||
/* first try: use _NET_FRAME_EXTENTS */
|
||||
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
||||
gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_FRAME_EXTENTS"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type_return,
|
||||
&format_return, &nitems_return, &bytes_after_return,
|
||||
&data)
|
||||
== Success)
|
||||
{
|
||||
if ((type_return == XA_CARDINAL) && (format_return == 32) &&
|
||||
(nitems_return == 4) && (data))
|
||||
{
|
||||
gulong *ldata = (gulong *) data;
|
||||
got_frame_extents = TRUE;
|
||||
|
||||
/* try to get the real client window geometry */
|
||||
if (XGetGeometry (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
||||
&root, &wx, &wy, &ww, &wh, &wb, &wd) &&
|
||||
XTranslateCoordinates (GDK_DISPLAY_XDISPLAY (display),
|
||||
xwindow, root, 0, 0, &wx, &wy, &child))
|
||||
{
|
||||
rect->x = wx;
|
||||
rect->y = wy;
|
||||
rect->width = ww;
|
||||
rect->height = wh;
|
||||
}
|
||||
|
||||
/* _NET_FRAME_EXTENTS format is left, right, top, bottom */
|
||||
rect->x -= ldata[0];
|
||||
rect->y -= ldata[2];
|
||||
rect->width += ldata[0] + ldata[1];
|
||||
rect->height += ldata[2] + ldata[3];
|
||||
}
|
||||
|
||||
if (data)
|
||||
XFree (data);
|
||||
}
|
||||
|
||||
if (got_frame_extents)
|
||||
goto out;
|
||||
|
||||
/* no frame extents property available, which means we either have a WM that
|
||||
is not EWMH compliant or is broken - try fallback and walk up the window
|
||||
tree to get our window's parent which hopefully is the window frame */
|
||||
|
||||
/* use NETWM_VIRTUAL_ROOTS if available */
|
||||
root = GDK_WINDOW_XROOTWIN (window);
|
||||
|
||||
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), root,
|
||||
gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_VIRTUAL_ROOTS"),
|
||||
@@ -3478,7 +3531,7 @@ gdk_window_get_frame_extents (GdkWindow *window,
|
||||
if (!XQueryTree (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
||||
&root, &xparent,
|
||||
&children, &nchildren))
|
||||
goto fail;
|
||||
goto out;
|
||||
|
||||
if (children)
|
||||
XFree (children);
|
||||
@@ -3504,7 +3557,7 @@ gdk_window_get_frame_extents (GdkWindow *window,
|
||||
rect->height = wh;
|
||||
}
|
||||
|
||||
fail:
|
||||
out:
|
||||
if (vroots)
|
||||
XFree (vroots);
|
||||
|
||||
|
||||
+21
-3
@@ -14,7 +14,6 @@ cp -p @abs_srcdir@/COPYING share/doc/gtk+-dev-@GTK_VERSION@
|
||||
|
||||
rm $ZIP
|
||||
zip $ZIP -@ <<EOF
|
||||
COPYING.LIB-2
|
||||
etc/gtk-2.0/gdk-pixbuf.loaders
|
||||
etc/gtk-2.0/gtkrc
|
||||
etc/gtk-2.0/gtk.immodules
|
||||
@@ -32,8 +31,21 @@ 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 $ZIP lib/locale/*/LC_MESSAGES/gtk20.mo
|
||||
zip $ZIP lib/locale/*/LC_MESSAGES/gtk20-properties.mo
|
||||
if [ -f lib/locale/de/LC_MESSAGES/gtk20.mo -a -f share/locale/de/LC_MESSAGES/gtk20.mo ]; then
|
||||
if [ lib/locale/de/LC_MESSAGES/gtk20.mo -nt share/locale/de/LC_MESSAGES/gtk20.mo ]; then
|
||||
zip -r $ZIP lib/locale/*/LC_MESSAGES/gtk20.mo
|
||||
zip -r $ZIP lib/locale/*/LC_MESSAGES/gtk20-properties.mo
|
||||
else
|
||||
zip -r $ZIP share/locale/*/LC_MESSAGES/gtk20.mo
|
||||
zip -r $ZIP share/locale/*/LC_MESSAGES/gtk20-properties.mo
|
||||
fi
|
||||
elif [ -f lib/locale/de/LC_MESSAGES/gtk20.mo ]; then
|
||||
zip -r $ZIP lib/locale/*/LC_MESSAGES/gtk20.mo
|
||||
zip -r $ZIP lib/locale/*/LC_MESSAGES/gtk20-properties.mo
|
||||
else
|
||||
zip -r $ZIP share/locale/*/LC_MESSAGES/gtk20.mo
|
||||
zip -r $ZIP share/locale/*/LC_MESSAGES/gtk20-properties.mo
|
||||
fi
|
||||
|
||||
zip -r $ZIP share/doc/gtk+-@GTK_VERSION@
|
||||
|
||||
@@ -41,8 +53,14 @@ rm $DEVZIP
|
||||
zip -r $DEVZIP -@ <<EOF
|
||||
include/gtk-2.0
|
||||
bin/gdk-pixbuf-csource.exe
|
||||
bin/gtk-builder-convert
|
||||
bin/gtk-demo.exe
|
||||
bin/gtk-update-icon-cache.exe
|
||||
man/man1/gdk-builder-convert.1
|
||||
man/man1/gdk-pixbuf-csource.1
|
||||
man/man1/gdk-update-icon-cache.1
|
||||
man/man1/gtk-pixbuf-query-loaders.1
|
||||
man/man1/gtk-query-immodules-2.0.1
|
||||
lib/libgdk_pixbuf-@GTK_API_VERSION@.dll.a
|
||||
lib/gdk_pixbuf-@GTK_API_VERSION@.lib
|
||||
lib/libgdk-win32-@GTK_API_VERSION@.dll.a
|
||||
|
||||
+15
-9
@@ -4,8 +4,12 @@ SUBDIRS=theme-bits
|
||||
|
||||
if OS_UNIX
|
||||
SUBDIRS += xdgmime
|
||||
if USE_QUARTZ
|
||||
GTK_PRINT_PREVIEW_COMMAND="/Applications/Preview.app/Contents/MacOS/Preview %f"
|
||||
else
|
||||
GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview --print-settings %s %f"
|
||||
endif
|
||||
endif
|
||||
|
||||
DIST_SUBDIRS=theme-bits xdgmime
|
||||
|
||||
@@ -47,7 +51,7 @@ endif
|
||||
|
||||
if OS_WIN32
|
||||
gtk_def = gtk.def
|
||||
gtk_win32_symbols = -export-symbols gtk.def
|
||||
gtk_win32_symbols = -export-symbols $(srcdir)/gtk.def
|
||||
|
||||
gtk_win32_res = gtk-win32-res.o
|
||||
gtk_win32_res_ldflag = -Wl,gtk-win32-res.o
|
||||
@@ -56,7 +60,7 @@ gtk-win32-res.o : gtk-win32.rc
|
||||
$(WINDRES) gtk-win32.rc $@
|
||||
|
||||
install-def-file: gtk.def
|
||||
$(INSTALL) gtk.def $(DESTDIR)$(libdir)/gtk-win32-2.0.def
|
||||
$(INSTALL) $(srcdir)/gtk.def $(DESTDIR)$(libdir)/gtk-win32-2.0.def
|
||||
uninstall-def-file:
|
||||
-rm $(DESTDIR)$(libdir)/gtk-win32-2.0.def
|
||||
else
|
||||
@@ -80,8 +84,10 @@ install-ms-lib:
|
||||
uninstall-ms-lib:
|
||||
endif
|
||||
|
||||
# This places the generated .def file in srcdir, since it is expected to be there.
|
||||
# (The one from a tarball is)
|
||||
gtk.def: gtk.symbols
|
||||
(echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gtk.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > gtk.def
|
||||
(echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gtk.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > $(srcdir)/gtk.def
|
||||
|
||||
gtkalias.h: gtk.symbols
|
||||
$(PERL) $(srcdir)/makegtkalias.pl < $(srcdir)/gtk.symbols > gtkalias.h
|
||||
@@ -341,8 +347,6 @@ gtk_semi_private_h_sources = \
|
||||
gtk_private_h_sources = \
|
||||
gtkquery.h \
|
||||
gtksearchengine.h \
|
||||
gtksearchenginebeagle.h \
|
||||
gtksearchenginetracker.h\
|
||||
gtksearchenginesimple.h \
|
||||
gtkdndcursors.h \
|
||||
gtkentryprivate.h \
|
||||
@@ -388,8 +392,6 @@ gtk_private_h_sources = \
|
||||
gtk_base_c_sources = \
|
||||
gtkquery.c \
|
||||
gtksearchengine.c \
|
||||
gtksearchenginebeagle.c \
|
||||
gtksearchenginetracker.c\
|
||||
gtksearchenginesimple.c \
|
||||
fnmatch.c \
|
||||
gtkaboutdialog.c \
|
||||
@@ -626,7 +628,9 @@ gtk_os_unix_c_sources = \
|
||||
gtkprintjob.c \
|
||||
gtkprintoperation-unix.c \
|
||||
gtkprintunixdialog.c \
|
||||
gtkprintbackend.c
|
||||
gtkprintbackend.c \
|
||||
gtksearchenginebeagle.c \
|
||||
gtksearchenginetracker.c
|
||||
gtk_all_c_sources += $(gtk_os_unix_c_sources)
|
||||
if OS_UNIX
|
||||
gtk_private_h_sources += \
|
||||
@@ -636,7 +640,9 @@ gtk_private_h_sources += \
|
||||
gtkprinter-private.h \
|
||||
gtkprinteroption.h \
|
||||
gtkprinteroptionset.h \
|
||||
gtkprinteroptionwidget.h
|
||||
gtkprinteroptionwidget.h \
|
||||
gtksearchenginebeagle.h \
|
||||
gtksearchenginetracker.h
|
||||
gtk_c_sources += $(gtk_os_unix_c_sources)
|
||||
endif
|
||||
|
||||
|
||||
+126
-75
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (C) 2006-2007 Async Open Source
|
||||
# Copyright (C) 2006-2008 Async Open Source
|
||||
# Henrique Romano <henrique@async.com.br>
|
||||
# Johan Dahlin <jdahlin@async.com.br>
|
||||
#
|
||||
@@ -58,7 +58,7 @@ def get_child_nodes(node):
|
||||
assert node.tagName == 'object'
|
||||
nodes = []
|
||||
for child in node.childNodes:
|
||||
if child.nodeType == Node.TEXT_NODE:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName != 'child':
|
||||
continue
|
||||
@@ -69,7 +69,7 @@ def get_properties(node):
|
||||
assert node.tagName == 'object'
|
||||
properties = {}
|
||||
for child in node.childNodes:
|
||||
if child.nodeType == Node.TEXT_NODE:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName != 'property':
|
||||
continue
|
||||
@@ -82,11 +82,22 @@ def get_property(node, property_name):
|
||||
properties = get_properties(node)
|
||||
return properties.get(property_name)
|
||||
|
||||
def get_property_node(node, property_name):
|
||||
assert node.tagName == 'object'
|
||||
properties = {}
|
||||
for child in node.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName != 'property':
|
||||
continue
|
||||
if child.getAttribute('name') == property_name:
|
||||
return child
|
||||
|
||||
def get_signal_nodes(node):
|
||||
assert node.tagName == 'object'
|
||||
signals = []
|
||||
for child in node.childNodes:
|
||||
if child.nodeType == Node.TEXT_NODE:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName == 'signal':
|
||||
signals.append(child)
|
||||
@@ -96,8 +107,9 @@ def get_property_nodes(node):
|
||||
assert node.tagName == 'object'
|
||||
properties = []
|
||||
for child in node.childNodes:
|
||||
if child.nodeType == Node.TEXT_NODE:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
# FIXME: handle comments
|
||||
if child.tagName == 'property':
|
||||
properties.append(child)
|
||||
return properties
|
||||
@@ -106,17 +118,17 @@ def get_accelerator_nodes(node):
|
||||
assert node.tagName == 'object'
|
||||
accelerators = []
|
||||
for child in node.childNodes:
|
||||
if child.nodeType == Node.TEXT_NODE:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName == 'accelerator':
|
||||
accelerators.append(child)
|
||||
return accelerators
|
||||
|
||||
def get_object_node(child_node):
|
||||
assert child_node.tagName == 'child'
|
||||
assert child_node.tagName == 'child', child_node
|
||||
nodes = []
|
||||
for node in child_node.childNodes:
|
||||
if node.nodeType == Node.TEXT_NODE:
|
||||
if node.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if node.tagName == 'object':
|
||||
nodes.append(node)
|
||||
@@ -126,9 +138,11 @@ def get_object_node(child_node):
|
||||
def copy_properties(node, props, prop_dict):
|
||||
assert node.tagName == 'object'
|
||||
for prop_name in props:
|
||||
value = get_property(node, prop_name)
|
||||
if value is not None:
|
||||
prop_dict[prop_name] = value
|
||||
child = get_property_node(node, prop_name)
|
||||
if child is not None:
|
||||
prop_dict[prop_name] = child
|
||||
|
||||
return node
|
||||
|
||||
class GtkBuilderConverter(object):
|
||||
|
||||
@@ -165,7 +179,22 @@ class GtkBuilderConverter(object):
|
||||
return [w for w in self._dom.getElementsByTagName("object")
|
||||
if w.getAttribute(attribute) == value]
|
||||
|
||||
def _create_object(self, obj_class, obj_id, template=None, **properties):
|
||||
def _create_object(self, obj_class, obj_id, template=None, properties=None):
|
||||
"""
|
||||
Creates a new <object> tag.
|
||||
Optionally a name template can be provided which will be used
|
||||
to avoid naming collisions.
|
||||
The properties dictionary can either contain string values or Node
|
||||
values. If a node is provided the name of the node will be overridden
|
||||
by the dictionary key.
|
||||
|
||||
@param obj_class: class of the object (class tag)
|
||||
@param obj_id: identifier of the object (id tag)
|
||||
@param template: name template to use, for example 'button'
|
||||
@param properties: dictionary of properties
|
||||
@type properties: string or Node.
|
||||
@returns: Newly created node of the object
|
||||
"""
|
||||
if template is not None:
|
||||
count = 1
|
||||
while True:
|
||||
@@ -179,16 +208,23 @@ class GtkBuilderConverter(object):
|
||||
obj = self._dom.createElement('object')
|
||||
obj.setAttribute('class', obj_class)
|
||||
obj.setAttribute('id', obj_id)
|
||||
for name, value in properties.items():
|
||||
prop = self._dom.createElement('property')
|
||||
prop.setAttribute('name', name)
|
||||
prop.appendChild(self._dom.createTextNode(value))
|
||||
obj.appendChild(prop)
|
||||
if properties:
|
||||
for name, value in properties.items():
|
||||
if isinstance(value, Node):
|
||||
# Reuse the node, so translatable and context still will be
|
||||
# set when converting nodes. See also #509153
|
||||
prop = value
|
||||
else:
|
||||
prop = self._dom.createElement('property')
|
||||
prop.appendChild(self._dom.createTextNode(value))
|
||||
|
||||
prop.setAttribute('name', str(name))
|
||||
obj.appendChild(prop)
|
||||
self.objects[obj_id] = obj
|
||||
return obj
|
||||
|
||||
def _create_root_object(self, obj_class, template, **properties):
|
||||
obj = self._create_object(obj_class, None, template, **properties)
|
||||
def _create_root_object(self, obj_class, template, properties=None):
|
||||
obj = self._create_object(obj_class, None, template, properties)
|
||||
self.root_objects.append(obj)
|
||||
return obj
|
||||
|
||||
@@ -227,6 +263,10 @@ class GtkBuilderConverter(object):
|
||||
for node in self._dom.getElementsByTagName("ui"):
|
||||
self._convert_ui(node)
|
||||
|
||||
# Convert accessibility tag
|
||||
for node in self._dom.getElementsByTagName("accessibility"):
|
||||
self._convert_accessibility(node)
|
||||
|
||||
# Output the newly created root objects and sort them
|
||||
# by attribute id
|
||||
for obj in sorted(self.root_objects,
|
||||
@@ -241,9 +281,11 @@ class GtkBuilderConverter(object):
|
||||
self._packing_prop_to_child_attr(
|
||||
node, "type", "label_item", "label")
|
||||
elif klass == "GtkMenuBar":
|
||||
self._convert_menubar(node)
|
||||
elif klass == "GtkMenu":
|
||||
self._convert_menu(node)
|
||||
elif klass == "GtkMenu":
|
||||
# Only convert toplevel popups
|
||||
if node.parentNode == self._interface:
|
||||
self._convert_menu(node, popup=True)
|
||||
elif klass in WINDOWS and self.skip_windows:
|
||||
self._remove_window(node)
|
||||
self._default_widget_converter(node)
|
||||
@@ -279,42 +321,20 @@ class GtkBuilderConverter(object):
|
||||
parent.removeChild(node)
|
||||
parent.appendChild(object_node)
|
||||
|
||||
def _convert_menubar(self, node):
|
||||
def _convert_menu(self, node, popup=False):
|
||||
if node.hasAttribute('constructor'):
|
||||
return
|
||||
|
||||
uimgr = self._create_root_object('GtkUIManager',
|
||||
template='uimanager')
|
||||
|
||||
menubar = self._dom.createElement('menubar')
|
||||
menubar.setAttribute('name', node.getAttribute('id'))
|
||||
node.setAttribute('constructor', uimgr.getAttribute('id'))
|
||||
if popup:
|
||||
name = 'popup'
|
||||
else:
|
||||
name = 'menubar'
|
||||
|
||||
for child in get_child_nodes(node):
|
||||
obj_node = get_object_node(child)
|
||||
item = self._convert_menuitem(uimgr, obj_node)
|
||||
menubar.appendChild(item)
|
||||
child.removeChild(obj_node)
|
||||
child.parentNode.removeChild(child)
|
||||
|
||||
ui = self._dom.createElement('ui')
|
||||
uimgr.appendChild(ui)
|
||||
|
||||
ui.appendChild(menubar)
|
||||
|
||||
def _convert_menu(self, node):
|
||||
if node.hasAttribute('constructor'):
|
||||
return
|
||||
|
||||
# Only convert toplevel menu objects
|
||||
if node.parentNode != self._interface:
|
||||
return
|
||||
uimgr = self._create_root_object('GtkUIManager',
|
||||
template='uimanager')
|
||||
|
||||
menu = self._dom.createElement('menubar')
|
||||
menu = self._dom.createElement(name)
|
||||
menu.setAttribute('name', node.getAttribute('id'))
|
||||
|
||||
node.setAttribute('constructor', uimgr.getAttribute('id'))
|
||||
|
||||
for child in get_child_nodes(node):
|
||||
@@ -362,7 +382,7 @@ class GtkBuilderConverter(object):
|
||||
return menu
|
||||
|
||||
def _menuitem_to_action(self, node, properties):
|
||||
copy_properties(node, ['label'], properties)
|
||||
copy_properties(node, ['label', 'tooltip'], properties)
|
||||
|
||||
def _togglemenuitem_to_action(self, node, properties):
|
||||
self._menuitem_to_action(node, properties)
|
||||
@@ -391,27 +411,27 @@ class GtkBuilderConverter(object):
|
||||
if (children and
|
||||
children[0].getAttribute('internal-child') == 'image'):
|
||||
image = get_object_node(children[0])
|
||||
stock_id = get_property(image, 'stock')
|
||||
if stock_id is not None:
|
||||
properties['stock_id'] = stock_id
|
||||
child = get_property_node(image, 'stock')
|
||||
if child is not None:
|
||||
properties['stock_id'] = child
|
||||
self._menuitem_to_action(node, properties)
|
||||
elif object_class == 'GtkSeparatorMenuItem':
|
||||
return
|
||||
else:
|
||||
raise NotImplementedError(object_class)
|
||||
|
||||
if get_property(node, 'use_stock') == 'True':
|
||||
stock_id = get_property(node, 'label')
|
||||
if stock_id is not None:
|
||||
properties['stock_id'] = stock_id
|
||||
if 'label' in properties:
|
||||
properties['stock_id'] = properties['label']
|
||||
del properties['label']
|
||||
|
||||
properties['name'] = object_id
|
||||
action = self._create_object(name,
|
||||
object_id,
|
||||
**properties)
|
||||
|
||||
properties=properties)
|
||||
for signal in get_signal_nodes(node):
|
||||
signal_name = signal.getAttribute('name')
|
||||
if signal_name == 'activate':
|
||||
if signal_name in ['activate', 'toggled']:
|
||||
action.appendChild(signal)
|
||||
else:
|
||||
print 'Unhandled signal %s::%s' % (node.getAttribute('class'),
|
||||
@@ -480,7 +500,7 @@ class GtkBuilderConverter(object):
|
||||
|
||||
# 2) Get dialogs action-widgets tag, create if not found
|
||||
for child in dialog.childNodes:
|
||||
if child.nodeType == Node.TEXT_NODE:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName == 'action-widgets':
|
||||
actions = child
|
||||
@@ -496,20 +516,28 @@ class GtkBuilderConverter(object):
|
||||
actions.appendChild(action)
|
||||
|
||||
def _convert_adjustment(self, prop):
|
||||
data = prop.childNodes[0].data
|
||||
value, lower, upper, step, page, page_size = data.split(' ')
|
||||
properties = {}
|
||||
if prop.childNodes:
|
||||
data = prop.childNodes[0].data
|
||||
value, lower, upper, step, page, page_size = data.split(' ')
|
||||
properties.update(value=value,
|
||||
lower=lower,
|
||||
upper=upper,
|
||||
step_increment=step,
|
||||
page_increment=page,
|
||||
page_size=page_size)
|
||||
else:
|
||||
prop.appendChild(self._dom.createTextNode(""))
|
||||
|
||||
adj = self._create_root_object("GtkAdjustment",
|
||||
template='adjustment',
|
||||
value=value,
|
||||
lower=lower,
|
||||
upper=upper,
|
||||
step_increment=step,
|
||||
page_increment=page,
|
||||
page_size=page_size)
|
||||
properties=properties)
|
||||
prop.childNodes[0].data = adj.getAttribute('id')
|
||||
|
||||
def _convert_combobox_items(self, node, prop):
|
||||
parent = prop.parentNode
|
||||
if not prop.childNodes:
|
||||
parent.removeChild(prop)
|
||||
return
|
||||
value = prop.childNodes[0].data
|
||||
model = self._create_root_object("GtkListStore",
|
||||
@@ -534,7 +562,6 @@ class GtkBuilderConverter(object):
|
||||
col.appendChild(self._dom.createTextNode(item))
|
||||
row.appendChild(col)
|
||||
|
||||
parent = prop.parentNode
|
||||
model_prop = self._dom.createElement('property')
|
||||
model_prop.setAttribute('name', 'model')
|
||||
model_prop.appendChild(
|
||||
@@ -567,7 +594,7 @@ class GtkBuilderConverter(object):
|
||||
prop.removeAttribute('translatable')
|
||||
tbuffer = self._create_root_object("GtkTextBuffer",
|
||||
template='textbuffer',
|
||||
text=data)
|
||||
properties=dict(text=data))
|
||||
prop.childNodes[0].data = tbuffer.getAttribute('id')
|
||||
|
||||
def _packing_prop_to_child_attr(self, node, prop_name, prop_val,
|
||||
@@ -609,6 +636,35 @@ class GtkBuilderConverter(object):
|
||||
widget.getAttributeNode("constructor").value = parent_id
|
||||
node.removeAttribute("id")
|
||||
|
||||
def _convert_accessibility(self, node):
|
||||
objectNode = node.parentNode
|
||||
parent_id = objectNode.getAttribute("id")
|
||||
|
||||
properties = {}
|
||||
for node in node.childNodes:
|
||||
if node.nodeName == 'atkproperty':
|
||||
node.tagName = 'property'
|
||||
properties[node.getAttribute('name')] = node
|
||||
node.parentNode.removeChild(node)
|
||||
elif node.nodeName == 'atkrelation':
|
||||
node.tagName = 'relation'
|
||||
relation_type = node.getAttribute('type')
|
||||
relation_type = relation_type.replace('_', '-')
|
||||
node.setAttribute('type', relation_type)
|
||||
elif node.nodeName == 'atkaction':
|
||||
node.tagName = 'action'
|
||||
|
||||
if properties:
|
||||
child = self._dom.createElement('child')
|
||||
child.setAttribute("internal-child", "accessible")
|
||||
|
||||
atkobject = self._create_object(
|
||||
"AtkObject", None,
|
||||
template='a11y-%s' % (parent_id,),
|
||||
properties=properties)
|
||||
child.appendChild(atkobject)
|
||||
objectNode.appendChild(child)
|
||||
|
||||
def _strip_root(self, root_name):
|
||||
for widget in self._dom.getElementsByTagName("widget"):
|
||||
if widget.getAttribute('id') == root_name:
|
||||
@@ -617,16 +673,11 @@ class GtkBuilderConverter(object):
|
||||
raise SystemExit("Could not find an object called `%s'" % (
|
||||
root_name))
|
||||
|
||||
# If it's already a root object, don't do anything
|
||||
if widget.parentNode is self._interface:
|
||||
return
|
||||
|
||||
for child in self._interface.childNodes[:]:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
child.parentNode.removeChild(child)
|
||||
|
||||
widget.parentNode.removeChild(widget)
|
||||
self._interface.appendChild(widget)
|
||||
|
||||
|
||||
|
||||
@@ -1715,7 +1715,8 @@ credits_key_press_event (GtkWidget *text_view,
|
||||
|
||||
switch (event->keyval)
|
||||
{
|
||||
case GDK_Return:
|
||||
case GDK_Return:
|
||||
case GDK_ISO_Enter:
|
||||
case GDK_KP_Enter:
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
|
||||
gtk_text_buffer_get_iter_at_mark (buffer, &iter,
|
||||
|
||||
+10
-4
@@ -637,7 +637,8 @@ _gtk_action_sync_menu_visible (GtkAction *action,
|
||||
GtkWidget *proxy,
|
||||
gboolean empty)
|
||||
{
|
||||
gboolean visible, hide_if_empty;
|
||||
gboolean visible = TRUE;
|
||||
gboolean hide_if_empty = TRUE;
|
||||
|
||||
g_return_if_fail (GTK_IS_MENU_ITEM (proxy));
|
||||
g_return_if_fail (action == NULL || GTK_IS_ACTION (action));
|
||||
@@ -645,8 +646,12 @@ _gtk_action_sync_menu_visible (GtkAction *action,
|
||||
if (action == NULL)
|
||||
action = g_object_get_qdata (G_OBJECT (proxy), quark_gtk_action_proxy);
|
||||
|
||||
visible = gtk_action_is_visible (action);
|
||||
hide_if_empty = action->private_data->hide_if_empty;
|
||||
if (action)
|
||||
{
|
||||
/* a GtkMenu for a <popup/> doesn't have to have an action */
|
||||
visible = gtk_action_is_visible (action);
|
||||
hide_if_empty = action->private_data->hide_if_empty;
|
||||
}
|
||||
|
||||
if (visible && !(empty && hide_if_empty))
|
||||
gtk_widget_show (proxy);
|
||||
@@ -916,7 +921,8 @@ gtk_action_create_icon (GtkAction *action, GtkIconSize icon_size)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_ACTION (action), NULL);
|
||||
|
||||
if (action->private_data->stock_id)
|
||||
if (action->private_data->stock_id &&
|
||||
gtk_icon_factory_lookup_default (action->private_data->stock_id))
|
||||
return gtk_image_new_from_stock (action->private_data->stock_id, icon_size);
|
||||
else if (action->private_data->icon_name)
|
||||
return gtk_image_new_from_icon_name (action->private_data->icon_name, icon_size);
|
||||
|
||||
+19
-15
@@ -601,13 +601,13 @@ on_assistant_apply (GtkWidget *widget, GtkAssistant *assistant)
|
||||
|
||||
success = compute_next_step (assistant);
|
||||
|
||||
g_signal_emit (assistant, signals [APPLY], 0, priv->current_page->page);
|
||||
g_signal_emit (assistant, signals [APPLY], 0);
|
||||
|
||||
/* if the assistant hasn't switched to another page, just emit
|
||||
* the CLOSE signal, it't the last page in the assistant flow
|
||||
*/
|
||||
if (!success)
|
||||
g_signal_emit (assistant, signals [CLOSE], 0, priv->current_page->page);
|
||||
g_signal_emit (assistant, signals [CLOSE], 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -728,10 +728,10 @@ gtk_assistant_init (GtkAssistant *assistant)
|
||||
{
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->close, FALSE, FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->cancel, FALSE, FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->last, FALSE, FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->back, FALSE, FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->forward, FALSE, FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->apply, FALSE, FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->forward, FALSE, FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->back, FALSE, FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->last, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
gtk_widget_set_parent (priv->action_area, GTK_WIDGET (assistant));
|
||||
@@ -869,6 +869,9 @@ remove_page (GtkAssistant *assistant,
|
||||
while (page_node && !GTK_WIDGET_VISIBLE (((GtkAssistantPage *) page_node->data)->page))
|
||||
page_node = page_node->next;
|
||||
|
||||
if (page_node == element)
|
||||
page_node = page_node->next;
|
||||
|
||||
if (page_node)
|
||||
priv->current_page = page_node->data;
|
||||
else
|
||||
@@ -1110,16 +1113,16 @@ gtk_assistant_size_allocate (GtkWidget *widget,
|
||||
/* Header */
|
||||
gtk_widget_get_child_requisition (priv->header_image, &header_requisition);
|
||||
|
||||
header_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width + header_padding;
|
||||
header_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width + header_padding;
|
||||
header_allocation.x = GTK_CONTAINER (widget)->border_width + header_padding;
|
||||
header_allocation.y = GTK_CONTAINER (widget)->border_width + header_padding;
|
||||
header_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * header_padding;
|
||||
header_allocation.height = header_requisition.height;
|
||||
|
||||
gtk_widget_size_allocate (priv->header_image, &header_allocation);
|
||||
|
||||
/* Action area */
|
||||
child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
|
||||
child_allocation.y = allocation->y + allocation->height -
|
||||
child_allocation.x = GTK_CONTAINER (widget)->border_width;
|
||||
child_allocation.y = allocation->height -
|
||||
GTK_CONTAINER (widget)->border_width - priv->action_area->requisition.height;
|
||||
child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width;
|
||||
child_allocation.height = priv->action_area->requisition.height;
|
||||
@@ -1128,12 +1131,12 @@ gtk_assistant_size_allocate (GtkWidget *widget,
|
||||
|
||||
/* Sidebar */
|
||||
if (rtl)
|
||||
child_allocation.x = allocation->x + allocation->width -
|
||||
child_allocation.x = allocation->width -
|
||||
GTK_CONTAINER (widget)->border_width - priv->sidebar_image->requisition.width;
|
||||
else
|
||||
child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
|
||||
child_allocation.x = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width +
|
||||
child_allocation.y = GTK_CONTAINER (widget)->border_width +
|
||||
priv->header_image->allocation.height + 2 * header_padding;
|
||||
child_allocation.width = priv->sidebar_image->requisition.width;
|
||||
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
|
||||
@@ -1142,8 +1145,8 @@ gtk_assistant_size_allocate (GtkWidget *widget,
|
||||
gtk_widget_size_allocate (priv->sidebar_image, &child_allocation);
|
||||
|
||||
/* Pages */
|
||||
child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width + content_padding;
|
||||
child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width +
|
||||
child_allocation.x = GTK_CONTAINER (widget)->border_width + content_padding;
|
||||
child_allocation.y = GTK_CONTAINER (widget)->border_width +
|
||||
priv->header_image->allocation.height + 2 * header_padding + content_padding;
|
||||
child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * content_padding;
|
||||
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
|
||||
@@ -1519,7 +1522,8 @@ gtk_assistant_set_current_page (GtkAssistant *assistant,
|
||||
* initial page is != to 0
|
||||
*/
|
||||
if (GTK_WIDGET_MAPPED (assistant))
|
||||
priv->visited_pages = g_slist_prepend (priv->visited_pages, page);
|
||||
priv->visited_pages = g_slist_prepend (priv->visited_pages,
|
||||
priv->current_page);
|
||||
|
||||
set_current_page (assistant, page);
|
||||
}
|
||||
|
||||
+52
-24
@@ -67,7 +67,6 @@ struct _GtkBuilderPrivate
|
||||
GHashTable *objects;
|
||||
GSList *delayed_properties;
|
||||
GSList *signals;
|
||||
GSList *root_objects;
|
||||
gchar *filename;
|
||||
};
|
||||
|
||||
@@ -114,7 +113,7 @@ gtk_builder_init (GtkBuilder *builder)
|
||||
GtkBuilderPrivate);
|
||||
builder->priv->domain = NULL;
|
||||
builder->priv->objects = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, NULL);
|
||||
g_free, g_object_unref);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,9 +134,6 @@ gtk_builder_finalize (GObject *object)
|
||||
g_slist_foreach (priv->signals, (GFunc) _free_signal_info, NULL);
|
||||
g_slist_free (priv->signals);
|
||||
|
||||
g_slist_foreach (priv->root_objects, (GFunc) g_object_unref, NULL);
|
||||
g_slist_free (priv->root_objects);
|
||||
|
||||
G_OBJECT_CLASS (gtk_builder_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -338,7 +334,8 @@ gtk_builder_get_parameters (GtkBuilder *builder,
|
||||
static GObject *
|
||||
gtk_builder_get_internal_child (GtkBuilder *builder,
|
||||
ObjectInfo *info,
|
||||
const gchar *childname)
|
||||
const gchar *childname,
|
||||
GError **error)
|
||||
{
|
||||
GObject *obj = NULL;
|
||||
|
||||
@@ -363,14 +360,19 @@ gtk_builder_get_internal_child (GtkBuilder *builder,
|
||||
};
|
||||
|
||||
if (!obj)
|
||||
g_error ("Unknown internal child: %s\n", childname);
|
||||
|
||||
{
|
||||
g_set_error (error,
|
||||
GTK_BUILDER_ERROR,
|
||||
GTK_BUILDER_ERROR_INVALID_VALUE,
|
||||
"Unknown internal child: %s", childname);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
GObject *
|
||||
_gtk_builder_construct (GtkBuilder *builder,
|
||||
ObjectInfo *info)
|
||||
ObjectInfo *info,
|
||||
GError **error)
|
||||
{
|
||||
GArray *parameters, *construct_parameters;
|
||||
GType object_type;
|
||||
@@ -383,7 +385,14 @@ _gtk_builder_construct (GtkBuilder *builder,
|
||||
g_assert (info->class_name != NULL);
|
||||
object_type = gtk_builder_get_type_from_name (builder, info->class_name);
|
||||
if (object_type == G_TYPE_INVALID)
|
||||
g_error ("Invalid type: %s", info->class_name);
|
||||
{
|
||||
g_set_error (error,
|
||||
GTK_BUILDER_ERROR,
|
||||
GTK_BUILDER_ERROR_INVALID_VALUE,
|
||||
"Invalid object type `%s'",
|
||||
info->class_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gtk_builder_get_parameters (builder, object_type,
|
||||
info->id,
|
||||
@@ -397,23 +406,38 @@ _gtk_builder_construct (GtkBuilder *builder,
|
||||
|
||||
constructor = gtk_builder_get_object (builder, info->constructor);
|
||||
if (constructor == NULL)
|
||||
g_error ("Unknown constructor for %s: %s\n", info->id,
|
||||
info->constructor);
|
||||
|
||||
{
|
||||
g_set_error (error,
|
||||
GTK_BUILDER_ERROR,
|
||||
GTK_BUILDER_ERROR_INVALID_VALUE,
|
||||
"Unknown object constructor for %s: %s",
|
||||
info->id,
|
||||
info->constructor);
|
||||
g_array_free (parameters, TRUE);
|
||||
g_array_free (construct_parameters, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
obj = gtk_buildable_construct_child (GTK_BUILDABLE (constructor),
|
||||
builder,
|
||||
info->id);
|
||||
g_assert (obj != NULL);
|
||||
if (construct_parameters->len)
|
||||
g_warning ("Can't pass in construct-only parameters to %s", info->id);
|
||||
|
||||
g_object_ref (obj);
|
||||
}
|
||||
else if (info->parent && ((ChildInfo*)info->parent)->internal_child != NULL)
|
||||
{
|
||||
gchar *childname = ((ChildInfo*)info->parent)->internal_child;
|
||||
obj = gtk_builder_get_internal_child (builder, info, childname);
|
||||
obj = gtk_builder_get_internal_child (builder, info, childname, error);
|
||||
if (!obj)
|
||||
{
|
||||
g_array_free (parameters, TRUE);
|
||||
g_array_free (construct_parameters, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
if (construct_parameters->len)
|
||||
g_warning ("Can't pass in construct-only parameters to %s", childname);
|
||||
g_object_ref (obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -421,6 +445,18 @@ _gtk_builder_construct (GtkBuilder *builder,
|
||||
construct_parameters->len,
|
||||
(GParameter *)construct_parameters->data);
|
||||
|
||||
/* No matter what, make sure we have a reference.
|
||||
*
|
||||
* If it's an initially unowned object, sink it.
|
||||
* If it's not initially unowned then we have the reference already.
|
||||
*
|
||||
* In the case that this is a window it will be sunk already and
|
||||
* this is effectively a call to g_object_ref(). That's what
|
||||
* we want.
|
||||
*/
|
||||
if (G_IS_INITIALLY_UNOWNED (obj))
|
||||
g_object_ref_sink (obj);
|
||||
|
||||
GTK_NOTE (BUILDER,
|
||||
g_print ("created %s of type %s\n", info->id, info->class_name));
|
||||
|
||||
@@ -472,15 +508,7 @@ _gtk_builder_construct (GtkBuilder *builder,
|
||||
g_strdup (info->id),
|
||||
g_free);
|
||||
|
||||
|
||||
if (!info->parent && !GTK_IS_WINDOW (obj))
|
||||
{
|
||||
if (g_object_is_floating (obj))
|
||||
g_object_ref_sink (obj);
|
||||
|
||||
builder->priv->root_objects =
|
||||
g_slist_prepend (builder->priv->root_objects, obj);
|
||||
}
|
||||
/* we already own a reference to obj. put it in the hash table. */
|
||||
g_hash_table_insert (builder->priv->objects, g_strdup (info->id), obj);
|
||||
|
||||
return obj;
|
||||
|
||||
+27
-18
@@ -18,24 +18,20 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <glib/gfileutils.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <glib/gmacros.h>
|
||||
#include <glib/gmessages.h>
|
||||
#include <glib/gslist.h>
|
||||
#include <glib/gstrfuncs.h>
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gmodule.h>
|
||||
#include <gdk/gdkenumtypes.h>
|
||||
#include <gdk/gdkkeys.h>
|
||||
#include <gtk/gtktypeutils.h>
|
||||
#include "gtktypeutils.h"
|
||||
#include "gtkbuilderprivate.h"
|
||||
#include "gtkbuilder.h"
|
||||
#include "gtkbuildable.h"
|
||||
#include "gtkdebug.h"
|
||||
#include "gtktypeutils.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
static void free_property_info (PropertyInfo *info);
|
||||
@@ -186,8 +182,9 @@ _gtk_builder_boolean_from_string (const gchar *string,
|
||||
}
|
||||
|
||||
static GObject *
|
||||
builder_construct (ParserData *data,
|
||||
ObjectInfo *object_info)
|
||||
builder_construct (ParserData *data,
|
||||
ObjectInfo *object_info,
|
||||
GError **error)
|
||||
{
|
||||
GObject *object;
|
||||
|
||||
@@ -198,7 +195,10 @@ builder_construct (ParserData *data,
|
||||
|
||||
object_info->properties = g_slist_reverse (object_info->properties);
|
||||
|
||||
object = _gtk_builder_construct (data->builder, object_info);
|
||||
object = _gtk_builder_construct (data->builder, object_info, error);
|
||||
if (!object)
|
||||
return NULL;
|
||||
|
||||
g_assert (G_IS_OBJECT (object));
|
||||
|
||||
object_info->object = object;
|
||||
@@ -349,7 +349,7 @@ parse_child (ParserData *data,
|
||||
|
||||
child_info->parent = (CommonInfo*)object_info;
|
||||
|
||||
object_info->object = builder_construct (data, object_info);
|
||||
object_info->object = builder_construct (data, object_info, error);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -647,8 +647,13 @@ parse_custom (GMarkupParseContext *context,
|
||||
{
|
||||
ObjectInfo* object_info = (ObjectInfo*)parent_info;
|
||||
if (!object_info->object)
|
||||
object_info->object = _gtk_builder_construct (data->builder,
|
||||
object_info);
|
||||
{
|
||||
object_info->object = _gtk_builder_construct (data->builder,
|
||||
object_info,
|
||||
error);
|
||||
if (!object_info->object)
|
||||
return TRUE; /* A GError is already set */
|
||||
}
|
||||
g_assert (object_info->object);
|
||||
object = object_info->object;
|
||||
child = NULL;
|
||||
@@ -807,8 +812,12 @@ end_element (GMarkupParseContext *context,
|
||||
ObjectInfo *object_info = state_pop_info (data, ObjectInfo);
|
||||
ChildInfo* child_info = state_peek_info (data, ChildInfo);
|
||||
|
||||
object_info->object = builder_construct (data, object_info);
|
||||
|
||||
object_info->object = builder_construct (data, object_info, error);
|
||||
if (!object_info->object)
|
||||
{
|
||||
free_object_info (object_info);
|
||||
return;
|
||||
}
|
||||
if (child_info)
|
||||
child_info->object = object_info->object;
|
||||
|
||||
|
||||
@@ -103,7 +103,8 @@ void _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
|
||||
gsize length,
|
||||
GError **error);
|
||||
GObject * _gtk_builder_construct (GtkBuilder *builder,
|
||||
ObjectInfo *info);
|
||||
ObjectInfo *info,
|
||||
GError **error);
|
||||
void _gtk_builder_add (GtkBuilder *builder,
|
||||
ChildInfo *child_info);
|
||||
void _gtk_builder_add_signals (GtkBuilder *builder,
|
||||
|
||||
+14
-4
@@ -191,10 +191,10 @@ dates_difference(guint year1, guint mm1, guint dd1,
|
||||
#define HEADER_BG_COLOR(widget) (& (widget)->style->bg[GTK_WIDGET_STATE (widget)])
|
||||
#define SELECTED_BG_COLOR(widget) (& (widget)->style->base[GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
|
||||
#define SELECTED_FG_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_HAS_FOCUS (widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE])
|
||||
#define NORMAL_DAY_COLOR(widget) (& (widget)->style->fg[GTK_WIDGET_STATE (widget)])
|
||||
#define NORMAL_DAY_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_STATE (widget)])
|
||||
#define PREV_MONTH_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
|
||||
#define NEXT_MONTH_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
|
||||
#define MARKED_COLOR(widget) (& (widget)->style->fg[GTK_WIDGET_STATE (widget)])
|
||||
#define MARKED_COLOR(widget) (& (widget)->style->text[GTK_WIDGET_STATE (widget)])
|
||||
#define BACKGROUND_COLOR(widget) (& (widget)->style->base[GTK_WIDGET_STATE (widget)])
|
||||
#define HIGHLIGHT_BACK_COLOR(widget) (& (widget)->style->mid[GTK_WIDGET_STATE (widget)])
|
||||
|
||||
@@ -1417,7 +1417,10 @@ calendar_realize_week_numbers (GtkCalendar *calendar)
|
||||
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
|
||||
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
||||
attributes.x = widget->style->xthickness + INNER_BORDER;
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
||||
attributes.x = widget->style->xthickness + INNER_BORDER;
|
||||
else
|
||||
attributes.x = widget->allocation.width - priv->week_width - (widget->style->xthickness + INNER_BORDER);
|
||||
attributes.y = (priv->header_h + priv->day_name_h
|
||||
+ (widget->style->ythickness + INNER_BORDER));
|
||||
attributes.width = priv->week_width;
|
||||
@@ -1473,11 +1476,18 @@ gtk_calendar_realize (GtkWidget *widget)
|
||||
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
|
||||
| GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
|
||||
|
||||
attributes.x = priv->week_width + (widget->style->ythickness + INNER_BORDER);
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
||||
attributes.x = priv->week_width + (widget->style->ythickness + INNER_BORDER);
|
||||
else
|
||||
attributes.x = widget->style->ythickness + INNER_BORDER;
|
||||
|
||||
attributes.y = (priv->header_h + priv->day_name_h
|
||||
+ (widget->style->ythickness + INNER_BORDER));
|
||||
attributes.width = (widget->allocation.width - attributes.x
|
||||
- (widget->style->xthickness + INNER_BORDER));
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
||||
attributes.width -= priv->week_width;
|
||||
|
||||
attributes.height = priv->main_h;
|
||||
priv->main_win = gdk_window_new (widget->window,
|
||||
&attributes, attributes_mask);
|
||||
|
||||
+4
-3
@@ -735,7 +735,7 @@ gtk_cell_view_cell_layout_reorder (GtkCellLayout *layout,
|
||||
|
||||
g_return_if_fail (link != NULL);
|
||||
|
||||
cellview->priv->cell_list = g_list_remove_link (cellview->priv->cell_list,
|
||||
cellview->priv->cell_list = g_list_delete_link (cellview->priv->cell_list,
|
||||
link);
|
||||
cellview->priv->cell_list = g_list_insert (cellview->priv->cell_list,
|
||||
info, position);
|
||||
@@ -1105,7 +1105,8 @@ gtk_cell_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
||||
GMarkupParser *parser,
|
||||
gpointer *data)
|
||||
{
|
||||
if (parent_buildable_iface->custom_tag_start (buildable, builder, child,
|
||||
if (parent_buildable_iface->custom_tag_start &&
|
||||
parent_buildable_iface->custom_tag_start (buildable, builder, child,
|
||||
tagname, parser, data))
|
||||
return TRUE;
|
||||
|
||||
@@ -1123,7 +1124,7 @@ gtk_cell_view_buildable_custom_tag_end (GtkBuildable *buildable,
|
||||
if (strcmp (tagname, "attributes") == 0)
|
||||
_gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname,
|
||||
data);
|
||||
else
|
||||
else if (parent_buildable_iface->custom_tag_end)
|
||||
parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
|
||||
data);
|
||||
}
|
||||
|
||||
+38
-17
@@ -1,7 +1,7 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2000 Red Hat, Inc.
|
||||
* Copyright (C) 2004 Nokia Corporation
|
||||
* Copyright (C) 2006 Imendio AB
|
||||
* Copyright (C) 2006-2008 Imendio AB
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -94,26 +94,27 @@ struct _GtkClipboardClass
|
||||
GtkSelectionData selection_data;
|
||||
guint info;
|
||||
|
||||
selection_data.selection = clipboard->selection;
|
||||
selection_data.data = NULL;
|
||||
selection_data.target = _gtk_quartz_pasteboard_type_to_atom (type);
|
||||
if (!clipboard->target_list)
|
||||
return;
|
||||
|
||||
if (clipboard->target_list &&
|
||||
gtk_target_list_find (clipboard->target_list, selection_data.target, &info))
|
||||
memset (&selection_data, 0, sizeof (GtkSelectionData));
|
||||
|
||||
selection_data.selection = clipboard->selection;
|
||||
selection_data.target = _gtk_quartz_pasteboard_type_to_atom (type);
|
||||
selection_data.display = gdk_display_get_default ();
|
||||
selection_data.length = -1;
|
||||
|
||||
if (gtk_target_list_find (clipboard->target_list, selection_data.target, &info))
|
||||
{
|
||||
clipboard->get_func (clipboard, &selection_data,
|
||||
info,
|
||||
clipboard->user_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
selection_data.length = -1;
|
||||
}
|
||||
|
||||
_gtk_quartz_set_selection_data_for_pasteboard (clipboard->pasteboard,
|
||||
&selection_data);
|
||||
|
||||
_gtk_quartz_set_selection_data_for_pasteboard (clipboard->pasteboard,
|
||||
&selection_data);
|
||||
|
||||
g_free (selection_data.data);
|
||||
g_free (selection_data.data);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)pasteboardChangedOwner:(NSPasteboard *)sender
|
||||
@@ -393,6 +394,27 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard,
|
||||
|
||||
types = _gtk_quartz_target_entries_to_pasteboard_types (targets, n_targets);
|
||||
|
||||
if (!(clipboard->have_owner && have_owner) ||
|
||||
clipboard->user_data != user_data)
|
||||
{
|
||||
clipboard_unset (clipboard);
|
||||
|
||||
if (clipboard->get_func)
|
||||
{
|
||||
/* Calling unset() caused the clipboard contents to be reset!
|
||||
* Avoid leaking and return
|
||||
*/
|
||||
if (!(clipboard->have_owner && have_owner) ||
|
||||
clipboard->user_data != user_data)
|
||||
{
|
||||
(*clear_func) (clipboard, user_data);
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
clipboard->user_data = user_data;
|
||||
clipboard->have_owner = have_owner;
|
||||
if (have_owner)
|
||||
@@ -526,6 +548,7 @@ clipboard_unset (GtkClipboard *clipboard)
|
||||
|
||||
if (old_have_owner)
|
||||
{
|
||||
clipboard_remove_owner_notify (clipboard);
|
||||
clipboard->have_owner = FALSE;
|
||||
}
|
||||
|
||||
@@ -844,8 +867,6 @@ gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
|
||||
GdkAtom target)
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
gchar *name;
|
||||
NSData *data;
|
||||
GtkSelectionData *selection_data = NULL;
|
||||
|
||||
if (target == gdk_atom_intern_static_string ("TARGETS"))
|
||||
|
||||
@@ -1066,6 +1066,7 @@ palette_activate (GtkWidget *widget,
|
||||
/* should have a drawing area subclass with an activate signal */
|
||||
if ((event->keyval == GDK_space) ||
|
||||
(event->keyval == GDK_Return) ||
|
||||
(event->keyval == GDK_ISO_Enter) ||
|
||||
(event->keyval == GDK_KP_Enter) ||
|
||||
(event->keyval == GDK_KP_Space))
|
||||
{
|
||||
@@ -1327,6 +1328,7 @@ key_press (GtkWidget *invisible,
|
||||
{
|
||||
case GDK_space:
|
||||
case GDK_Return:
|
||||
case GDK_ISO_Enter:
|
||||
case GDK_KP_Enter:
|
||||
case GDK_KP_Space:
|
||||
grab_color_at_mouse (screen, x, y, data);
|
||||
|
||||
+3
-1
@@ -293,7 +293,9 @@ gtk_combo_window_key_press (GtkWidget *window,
|
||||
{
|
||||
guint state = event->state & gtk_accelerator_get_default_mod_mask ();
|
||||
|
||||
if ((event->keyval == GDK_Return || event->keyval == GDK_KP_Enter) &&
|
||||
if ((event->keyval == GDK_Return ||
|
||||
event->keyval == GDK_ISO_Enter ||
|
||||
event->keyval == GDK_KP_Enter) &&
|
||||
state == 0)
|
||||
{
|
||||
gtk_combo_popdown_list (combo);
|
||||
|
||||
+33
-19
@@ -2273,6 +2273,10 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
/* list mode */
|
||||
|
||||
/* Combobox thickness + border-width */
|
||||
int delta_x = shadow_width + GTK_CONTAINER (widget)->border_width;
|
||||
int delta_y = shadow_height + GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
/* button */
|
||||
GTK_COMBO_BOX_SIZE_ALLOCATE_BUTTON
|
||||
|
||||
@@ -2281,36 +2285,44 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
|
||||
child.x = allocation->x + req.width;
|
||||
else
|
||||
child.x = allocation->x;
|
||||
|
||||
child.y = allocation->y;
|
||||
child.width = allocation->width - req.width;
|
||||
child.height = allocation->height;
|
||||
|
||||
if (combo_box->priv->cell_view_frame)
|
||||
{
|
||||
child.width = MAX (1, child.width);
|
||||
child.height = MAX (1, child.height);
|
||||
child.x += delta_x;
|
||||
child.y += delta_y;
|
||||
child.width = MAX (1, child.width - delta_x * 2);
|
||||
child.height = MAX (1, child.height - delta_y * 2);
|
||||
gtk_widget_size_allocate (combo_box->priv->cell_view_frame, &child);
|
||||
|
||||
/* the sample */
|
||||
if (combo_box->priv->has_frame)
|
||||
{
|
||||
child.x +=
|
||||
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
|
||||
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness;
|
||||
child.y +=
|
||||
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
|
||||
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness;
|
||||
child.width -= 2 * (
|
||||
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
|
||||
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness);
|
||||
child.height -= 2 * (
|
||||
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
|
||||
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness);
|
||||
}
|
||||
if (combo_box->priv->has_frame)
|
||||
{
|
||||
delta_x = GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
|
||||
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness;
|
||||
delta_y = GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
|
||||
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness;
|
||||
|
||||
child.x += delta_x;
|
||||
child.y += delta_y;
|
||||
child.width -= delta_x * 2;
|
||||
child.height -= delta_y * 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
child.x += delta_x;
|
||||
child.y += delta_y;
|
||||
child.width -= delta_x * 2;
|
||||
child.height -= delta_y * 2;
|
||||
}
|
||||
|
||||
child.width = MAX (1, child.width);
|
||||
child.height = MAX (1, child.height);
|
||||
|
||||
gtk_widget_size_allocate (GTK_BIN (combo_box)->child, &child);
|
||||
}
|
||||
}
|
||||
@@ -3846,7 +3858,7 @@ gtk_combo_box_list_key_press (GtkWidget *widget,
|
||||
GtkComboBox *combo_box = GTK_COMBO_BOX (data);
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (event->keyval == GDK_Return || event->keyval == GDK_KP_Enter ||
|
||||
if (event->keyval == GDK_Return || event->keyval == GDK_ISO_Enter || event->keyval == GDK_KP_Enter ||
|
||||
event->keyval == GDK_space || event->keyval == GDK_KP_Space)
|
||||
{
|
||||
GtkTreeModel *model = NULL;
|
||||
@@ -5329,7 +5341,9 @@ gtk_cell_editable_key_press (GtkWidget *widget,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else if (event->keyval == GDK_Return)
|
||||
else if (event->keyval == GDK_Return ||
|
||||
event->keyval == GDK_ISO_Enter ||
|
||||
event->keyval == GDK_KP_Enter)
|
||||
{
|
||||
gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
|
||||
gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box));
|
||||
|
||||
@@ -306,7 +306,7 @@ gtk_combo_box_entry_contents_changed (GtkEntry *entry,
|
||||
*
|
||||
* Creates a new #GtkComboBoxEntry which has a #GtkEntry as child. After
|
||||
* construction, you should set a model using gtk_combo_box_set_model() and a
|
||||
* text_column * using gtk_combo_box_entry_set_text_column().
|
||||
* text column using gtk_combo_box_entry_set_text_column().
|
||||
*
|
||||
* Return value: A new #GtkComboBoxEntry.
|
||||
*
|
||||
|
||||
+9
-1
@@ -256,9 +256,12 @@ gtk_dialog_init (GtkDialog *dialog)
|
||||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
|
||||
}
|
||||
|
||||
static GtkBuildableIface *parent_buildable_iface;
|
||||
|
||||
static void
|
||||
gtk_dialog_buildable_interface_init (GtkBuildableIface *iface)
|
||||
{
|
||||
parent_buildable_iface = g_type_interface_peek_parent (iface);
|
||||
iface->get_internal_child = gtk_dialog_buildable_get_internal_child;
|
||||
iface->custom_tag_start = gtk_dialog_buildable_custom_tag_start;
|
||||
iface->custom_finished = gtk_dialog_buildable_custom_finished;
|
||||
@@ -1341,7 +1344,8 @@ gtk_dialog_buildable_custom_tag_start (GtkBuildable *buildable,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return parent_buildable_iface->custom_tag_start (buildable, builder, child,
|
||||
tagname, parser, data);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1359,7 +1363,11 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable,
|
||||
guint signal_id;
|
||||
|
||||
if (strcmp (tagname, "action-widgets"))
|
||||
{
|
||||
parent_buildable_iface->custom_finished (buildable, builder, child,
|
||||
tagname, user_data);
|
||||
return;
|
||||
}
|
||||
|
||||
dialog = GTK_DIALOG (buildable);
|
||||
parser_data = (ActionWidgetsSubParserData*)user_data;
|
||||
|
||||
@@ -4062,6 +4062,7 @@ gtk_drag_key_cb (GtkWidget *widget,
|
||||
|
||||
case GDK_space:
|
||||
case GDK_Return:
|
||||
case GDK_ISO_Enter:
|
||||
case GDK_KP_Enter:
|
||||
case GDK_KP_Space:
|
||||
gtk_drag_end (info, event->time);
|
||||
|
||||
@@ -820,6 +820,8 @@ gtk_entry_class_init (GtkEntryClass *class)
|
||||
*/
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_Return, 0,
|
||||
"activate", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0,
|
||||
"activate", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0,
|
||||
"activate", 0);
|
||||
|
||||
|
||||
@@ -504,6 +504,7 @@ gtk_entry_completion_init (GtkEntryCompletion *completion)
|
||||
/* pack it all */
|
||||
priv->popup_window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_window_set_resizable (GTK_WINDOW (priv->popup_window), FALSE);
|
||||
gtk_window_set_type_hint(GTK_WINDOW(priv->popup_window), GDK_WINDOW_TYPE_HINT_COMBO);
|
||||
g_signal_connect (priv->popup_window, "key_press_event",
|
||||
G_CALLBACK (gtk_entry_completion_popup_key_event),
|
||||
completion);
|
||||
|
||||
@@ -1049,6 +1049,9 @@ gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser)
|
||||
file_system = _gtk_file_chooser_get_file_system (chooser);
|
||||
|
||||
path = _gtk_file_chooser_get_current_folder_path (chooser);
|
||||
if (!path)
|
||||
return NULL;
|
||||
|
||||
uri = gtk_file_system_path_to_uri (file_system, path);
|
||||
gtk_file_path_free (path);
|
||||
|
||||
|
||||
+15
-12
@@ -162,18 +162,18 @@ struct _GtkFileChooserButtonPrivate
|
||||
guint8 n_volumes;
|
||||
guint8 n_shortcuts;
|
||||
guint8 n_bookmarks;
|
||||
guint8 has_bookmark_separator : 1;
|
||||
guint8 has_current_folder_separator : 1;
|
||||
guint8 has_current_folder : 1;
|
||||
guint8 has_other_separator : 1;
|
||||
guint has_bookmark_separator : 1;
|
||||
guint has_current_folder_separator : 1;
|
||||
guint has_current_folder : 1;
|
||||
guint has_other_separator : 1;
|
||||
|
||||
/* Used for hiding/showing the dialog when the button is hidden */
|
||||
guint8 active : 1;
|
||||
guint active : 1;
|
||||
|
||||
/* Used to track whether we need to set a default current folder on ::map() */
|
||||
guint8 folder_has_been_set : 1;
|
||||
guint folder_has_been_set : 1;
|
||||
|
||||
guint8 focus_on_click : 1;
|
||||
guint focus_on_click : 1;
|
||||
};
|
||||
|
||||
|
||||
@@ -348,15 +348,15 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class)
|
||||
widget_class->style_set = gtk_file_chooser_button_style_set;
|
||||
widget_class->screen_changed = gtk_file_chooser_button_screen_changed;
|
||||
widget_class->mnemonic_activate = gtk_file_chooser_button_mnemonic_activate;
|
||||
|
||||
|
||||
/**
|
||||
* GtkFileChooserButtons::file-set:
|
||||
* GtkFileChooserButton::file-set:
|
||||
* @widget: the object which received the signal.
|
||||
*
|
||||
* The ::file-set signal is emitted when the user selects a file.
|
||||
*
|
||||
*
|
||||
* Note that this signal is only emitted when the <emphasis>user</emphasis>
|
||||
* changes the file.
|
||||
* changes the file.
|
||||
*
|
||||
* Since: 2.12
|
||||
*/
|
||||
@@ -2407,7 +2407,10 @@ out:
|
||||
g_free (label_text);
|
||||
}
|
||||
else
|
||||
gtk_label_set_text (GTK_LABEL (priv->label), _(FALLBACK_DISPLAY_NAME));
|
||||
{
|
||||
gtk_label_set_text (GTK_LABEL (priv->label), _(FALLBACK_DISPLAY_NAME));
|
||||
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+156
-138
@@ -73,6 +73,7 @@
|
||||
#if defined (G_OS_UNIX)
|
||||
#include "gtkfilesystemunix.h"
|
||||
#elif defined (G_OS_WIN32)
|
||||
#include <windows.h>
|
||||
#include "gtkfilesystemwin32.h"
|
||||
#endif
|
||||
|
||||
@@ -83,7 +84,7 @@
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <locale.h> /* LC_ALL */
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
@@ -257,7 +258,7 @@ static const int num_file_list_source_targets = G_N_ELEMENTS (file_list_source_t
|
||||
|
||||
/* Target types for dropping into the file list */
|
||||
static const GtkTargetEntry file_list_dest_targets[] = {
|
||||
{ "text/uri-list", 0, TEXT_URI_LIST }
|
||||
{ "text/uri-list", GTK_TARGET_OTHER_WIDGET, TEXT_URI_LIST }
|
||||
};
|
||||
|
||||
static const int num_file_list_dest_targets = G_N_ELEMENTS (file_list_dest_targets);
|
||||
@@ -390,10 +391,6 @@ static void check_preview_change (GtkFileChooserDefault *impl);
|
||||
|
||||
static void filter_combo_changed (GtkComboBox *combo_box,
|
||||
GtkFileChooserDefault *impl);
|
||||
static void shortcuts_row_activated_cb (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
GtkFileChooserDefault *impl);
|
||||
|
||||
static gboolean shortcuts_key_press_event_cb (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
@@ -1040,7 +1037,7 @@ error_message_with_parent (GtkWindow *parent,
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
||||
"%s", detail);
|
||||
|
||||
if (parent->group)
|
||||
if (parent && parent->group)
|
||||
gtk_window_group_add_window (parent->group, GTK_WINDOW (dialog));
|
||||
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
@@ -1386,13 +1383,6 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
|
||||
volume = data;
|
||||
pixbuf = gtk_file_system_volume_render_icon (impl->file_system, volume, GTK_WIDGET (impl),
|
||||
impl->icon_size, NULL);
|
||||
|
||||
gtk_list_store_set (impl->shortcuts_model, &iter,
|
||||
SHORTCUTS_COL_PIXBUF, pixbuf,
|
||||
-1);
|
||||
|
||||
if (pixbuf)
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
else if (shortcut_type == SHORTCUT_TYPE_PATH)
|
||||
{
|
||||
@@ -1429,13 +1419,6 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
|
||||
icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
|
||||
pixbuf = gtk_icon_theme_load_icon (icon_theme, "gnome-fs-share",
|
||||
impl->icon_size, 0, NULL);
|
||||
|
||||
gtk_list_store_set (impl->shortcuts_model, &iter,
|
||||
SHORTCUTS_COL_PIXBUF, pixbuf,
|
||||
-1);
|
||||
|
||||
if (pixbuf)
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
}
|
||||
else if (shortcut_type == SHORTCUT_TYPE_SEARCH)
|
||||
@@ -1446,6 +1429,14 @@ shortcuts_reload_icons (GtkFileChooserDefault *impl)
|
||||
{
|
||||
pixbuf = render_recent_icon (impl);
|
||||
}
|
||||
|
||||
gtk_list_store_set (impl->shortcuts_model, &iter,
|
||||
SHORTCUTS_COL_PIXBUF, pixbuf,
|
||||
-1);
|
||||
|
||||
if (pixbuf)
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
}
|
||||
}
|
||||
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (impl->shortcuts_model),&iter));
|
||||
@@ -1700,38 +1691,44 @@ _gtk_file_chooser_label_for_uri (const gchar *uri)
|
||||
gchar *host, *label;
|
||||
|
||||
start = strstr (uri, "://");
|
||||
start += 3;
|
||||
path = strchr (start, '/');
|
||||
if (start)
|
||||
{
|
||||
start += 3;
|
||||
path = strchr (start, '/');
|
||||
if (path)
|
||||
end = path;
|
||||
else
|
||||
{
|
||||
end = uri + strlen (uri);
|
||||
path = "/";
|
||||
}
|
||||
|
||||
/* strip username */
|
||||
p = strchr (start, '@');
|
||||
if (p && p < end)
|
||||
{
|
||||
start = p + 1;
|
||||
}
|
||||
|
||||
if (path)
|
||||
end = path;
|
||||
p = strchr (start, ':');
|
||||
if (p && p < end)
|
||||
end = p;
|
||||
|
||||
host = g_strndup (start, end - start);
|
||||
|
||||
/* Translators: the first string is a path and the second string
|
||||
* is a hostname. Nautilus and the panel contain the same string
|
||||
* to translate.
|
||||
*/
|
||||
label = g_strdup_printf (_("%1$s on %2$s"), path, host);
|
||||
|
||||
g_free (host);
|
||||
}
|
||||
else
|
||||
{
|
||||
end = uri + strlen (uri);
|
||||
path = "/";
|
||||
label = g_strdup (uri);
|
||||
}
|
||||
|
||||
/* strip username */
|
||||
p = strchr (start, '@');
|
||||
if (p && p < end)
|
||||
{
|
||||
start = p + 1;
|
||||
}
|
||||
|
||||
p = strchr (start, ':');
|
||||
if (p && p < end)
|
||||
end = p;
|
||||
|
||||
host = g_strndup (start, end - start);
|
||||
|
||||
/* Translators: the first string is a path and the second string
|
||||
* is a hostname. Nautilus and the panel contain the same string
|
||||
* to translate.
|
||||
*/
|
||||
label = g_strdup_printf (_("%1$s on %2$s"), path, host);
|
||||
|
||||
g_free (host);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
@@ -2002,9 +1999,7 @@ shortcuts_append_paths (GtkFileChooserDefault *impl,
|
||||
|
||||
profile_start ("start", NULL);
|
||||
|
||||
/* As there is no separator now, we want to start there.
|
||||
*/
|
||||
start_row = shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
|
||||
start_row = shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR) + 1;
|
||||
num_inserted = 0;
|
||||
|
||||
for (; paths; paths = paths->next)
|
||||
@@ -2016,6 +2011,8 @@ shortcuts_append_paths (GtkFileChooserDefault *impl,
|
||||
if (impl->local_only &&
|
||||
!gtk_file_system_path_is_local (impl->file_system, path))
|
||||
continue;
|
||||
if (shortcut_find_position (impl, path) != -1)
|
||||
continue;
|
||||
|
||||
label = gtk_file_system_get_bookmark_label (impl->file_system, path);
|
||||
|
||||
@@ -2245,13 +2242,14 @@ shortcuts_add_bookmarks (GtkFileChooserDefault *impl)
|
||||
impl->num_bookmarks + 1);
|
||||
|
||||
impl->num_bookmarks = 0;
|
||||
shortcuts_insert_separator (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
|
||||
|
||||
bookmarks = gtk_file_system_list_bookmarks (impl->file_system);
|
||||
shortcuts_append_paths (impl, bookmarks);
|
||||
gtk_file_paths_free (bookmarks);
|
||||
|
||||
if (impl->num_bookmarks > 0)
|
||||
shortcuts_insert_separator (impl, SHORTCUTS_BOOKMARKS_SEPARATOR);
|
||||
if (impl->num_bookmarks == 0)
|
||||
shortcuts_remove_rows (impl, shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS_SEPARATOR), 1);
|
||||
|
||||
if (impl->shortcuts_pane_filter_model)
|
||||
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (impl->shortcuts_pane_filter_model));
|
||||
@@ -3657,8 +3655,22 @@ static void
|
||||
shortcuts_selection_changed_cb (GtkTreeSelection *selection,
|
||||
GtkFileChooserDefault *impl)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GtkTreeIter child_iter;
|
||||
|
||||
bookmarks_check_remove_sensitivity (impl);
|
||||
shortcuts_check_popup_sensitivity (impl);
|
||||
|
||||
if (impl->changing_folder)
|
||||
return;
|
||||
|
||||
if (gtk_tree_selection_get_selected(selection, NULL, &iter))
|
||||
{
|
||||
gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (impl->shortcuts_pane_filter_model),
|
||||
&child_iter,
|
||||
&iter);
|
||||
shortcuts_activate_iter (impl, &child_iter);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -3777,14 +3789,13 @@ shortcuts_build_popup_menu (GtkFileChooserDefault *impl)
|
||||
G_CALLBACK (rename_shortcut_cb), impl);
|
||||
gtk_widget_show (item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (impl->browse_shortcuts_popup_menu), item);
|
||||
|
||||
shortcuts_check_popup_sensitivity (impl);
|
||||
}
|
||||
|
||||
static void
|
||||
shortcuts_update_popup_menu (GtkFileChooserDefault *impl)
|
||||
{
|
||||
shortcuts_build_popup_menu (impl);
|
||||
shortcuts_check_popup_sensitivity (impl);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3930,7 +3941,7 @@ shortcuts_list_create (GtkFileChooserDefault *impl)
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
||||
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_shortcuts_tree_view));
|
||||
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
|
||||
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
|
||||
gtk_tree_selection_set_select_function (selection,
|
||||
shortcuts_select_func,
|
||||
impl, NULL);
|
||||
@@ -3938,9 +3949,6 @@ shortcuts_list_create (GtkFileChooserDefault *impl)
|
||||
g_signal_connect (selection, "changed",
|
||||
G_CALLBACK (shortcuts_selection_changed_cb), impl);
|
||||
|
||||
g_signal_connect (impl->browse_shortcuts_tree_view, "row_activated",
|
||||
G_CALLBACK (shortcuts_row_activated_cb), impl);
|
||||
|
||||
g_signal_connect (impl->browse_shortcuts_tree_view, "key_press_event",
|
||||
G_CALLBACK (shortcuts_key_press_event_cb), impl);
|
||||
|
||||
@@ -4076,7 +4084,8 @@ trap_activate_cb (GtkWidget *widget,
|
||||
if ((event->keyval == GDK_Return
|
||||
|| event->keyval == GDK_ISO_Enter
|
||||
|| event->keyval == GDK_KP_Enter
|
||||
|| event->keyval == GDK_space)
|
||||
|| event->keyval == GDK_space
|
||||
|| event->keyval == GDK_KP_Space)
|
||||
&& ((event->state & modifiers) == 0)
|
||||
&& !(impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
|
||||
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
|
||||
@@ -4628,7 +4637,7 @@ create_file_list (GtkFileChooserDefault *impl)
|
||||
GDK_BUTTON1_MASK,
|
||||
file_list_source_targets,
|
||||
num_file_list_source_targets,
|
||||
GDK_ACTION_COPY);
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
||||
|
||||
g_signal_connect (selection, "changed",
|
||||
G_CALLBACK (list_selection_changed), impl);
|
||||
@@ -5144,6 +5153,14 @@ location_mode_set (GtkFileChooserDefault *impl,
|
||||
static void
|
||||
location_toggle_popup_handler (GtkFileChooserDefault *impl)
|
||||
{
|
||||
/* when in search or recent files mode, we are not showing the
|
||||
* location_entry_box container, so there's no point in switching
|
||||
* to it.
|
||||
*/
|
||||
if (impl->operation_mode == OPERATION_MODE_SEARCH ||
|
||||
impl->operation_mode == OPERATION_MODE_RECENT)
|
||||
return;
|
||||
|
||||
/* If the file entry is not visible, show it.
|
||||
* If it is visible, turn it off only if it is focused. Otherwise, switch to the entry.
|
||||
*/
|
||||
@@ -6442,12 +6459,19 @@ static void
|
||||
browse_files_select_first_row (GtkFileChooserDefault *impl)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GtkTreeIter dummy_iter;
|
||||
GtkTreeModel *tree_model;
|
||||
|
||||
if (!impl->sort_model)
|
||||
return;
|
||||
|
||||
path = gtk_tree_path_new_from_indices (0, -1);
|
||||
gtk_tree_view_set_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, FALSE);
|
||||
tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (impl->browse_files_tree_view));
|
||||
|
||||
/* If the list is empty, do nothing. */
|
||||
if (gtk_tree_model_get_iter (tree_model, &dummy_iter, path))
|
||||
gtk_tree_view_set_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, FALSE);
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
@@ -6851,14 +6875,19 @@ update_chooser_entry (GtkFileChooserDefault *impl)
|
||||
g_strdup (gtk_file_info_get_display_name (info));
|
||||
|
||||
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
|
||||
impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
|
||||
impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
|
||||
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
|
||||
change_entry = !gtk_file_info_get_is_folder (info); /* We don't want the name to change when clicking on a folder... */
|
||||
else
|
||||
change_entry = TRUE; /* ... unless we are in one of the folder modes */
|
||||
change_entry = TRUE; /* ... unless we are in SELECT_FOLDER mode */
|
||||
|
||||
if (change_entry)
|
||||
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry),
|
||||
impl->browse_files_last_selected_name);
|
||||
{
|
||||
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), impl->browse_files_last_selected_name);
|
||||
|
||||
if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
|
||||
_gtk_file_chooser_entry_select_filename (GTK_FILE_CHOOSER_ENTRY (impl->location_entry));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -6879,7 +6908,8 @@ update_chooser_entry (GtkFileChooserDefault *impl)
|
||||
|
||||
maybe_clear_entry:
|
||||
|
||||
if (impl->browse_files_last_selected_name)
|
||||
if ((impl->action == GTK_FILE_CHOOSER_ACTION_OPEN || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
||||
&& impl->browse_files_last_selected_name)
|
||||
{
|
||||
const char *entry_text;
|
||||
int len;
|
||||
@@ -8085,9 +8115,14 @@ confirm_dialog_should_accept_filename (GtkFileChooserDefault *impl,
|
||||
folder_display_name);
|
||||
|
||||
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
|
||||
add_custom_button_to_dialog (GTK_DIALOG (dialog), _("_Replace"), GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT);
|
||||
add_custom_button_to_dialog (GTK_DIALOG (dialog), _("_Replace"),
|
||||
GTK_STOCK_SAVE_AS, GTK_RESPONSE_ACCEPT);
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
||||
GTK_RESPONSE_ACCEPT,
|
||||
GTK_RESPONSE_CANCEL,
|
||||
-1);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
|
||||
|
||||
|
||||
if (toplevel->group)
|
||||
gtk_window_group_add_window (toplevel->group, GTK_WINDOW (dialog));
|
||||
|
||||
@@ -8193,23 +8228,6 @@ should_respond_after_confirm_overwrite (GtkFileChooserDefault *impl,
|
||||
}
|
||||
}
|
||||
|
||||
/* Gives the focus to the browse tree view only if it is visible */
|
||||
static void
|
||||
focus_browse_tree_view_if_possible (GtkFileChooserDefault *impl)
|
||||
{
|
||||
gboolean do_focus;
|
||||
|
||||
if ((impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
|
||||
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
|
||||
&& !gtk_expander_get_expanded (GTK_EXPANDER (impl->save_expander)))
|
||||
do_focus = FALSE;
|
||||
else
|
||||
do_focus = TRUE;
|
||||
|
||||
if (do_focus)
|
||||
gtk_widget_grab_focus (impl->browse_files_tree_view);
|
||||
}
|
||||
|
||||
static void
|
||||
action_create_folder_cb (GtkFileSystemHandle *handle,
|
||||
const GtkFilePath *path,
|
||||
@@ -8604,25 +8622,6 @@ gtk_file_chooser_default_should_respond (GtkFileChooserEmbed *chooser_embed)
|
||||
gtk_file_path_free (path);
|
||||
return retval;
|
||||
}
|
||||
else if (impl->toplevel_last_focus_widget == impl->browse_shortcuts_tree_view)
|
||||
{
|
||||
/* The focus is on a dialog's action area button, *and* the widget that
|
||||
* was focused immediately before it is the shortcuts list. Switch to the
|
||||
* selected shortcut and tell the caller not to respond.
|
||||
*/
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (shortcuts_get_selected (impl, &iter))
|
||||
{
|
||||
shortcuts_activate_iter (impl, &iter);
|
||||
|
||||
focus_browse_tree_view_if_possible (impl);
|
||||
}
|
||||
else
|
||||
goto file_list;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
else if (impl->toplevel_last_focus_widget == impl->browse_files_tree_view)
|
||||
{
|
||||
/* The focus is on a dialog's action area button, *and* the widget that
|
||||
@@ -9867,7 +9866,7 @@ recent_sort_mru (gconstpointer a,
|
||||
GtkRecentInfo *info_a = (GtkRecentInfo *) a;
|
||||
GtkRecentInfo *info_b = (GtkRecentInfo *) b;
|
||||
|
||||
return (gtk_recent_info_get_modified (info_a) < gtk_recent_info_get_modified (info_b));
|
||||
return (gtk_recent_info_get_modified (info_b) - gtk_recent_info_get_modified (info_a));
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -10316,7 +10315,7 @@ shortcuts_activate_volume_mount_cb (GtkFileSystemHandle *handle,
|
||||
char *msg;
|
||||
|
||||
msg = g_strdup_printf (_("Could not mount %s"),
|
||||
gtk_file_system_volume_get_display_name (impl->file_system, volume));
|
||||
gtk_file_system_volume_get_display_name (impl->file_system, volume));
|
||||
error_message (impl, msg, error->message);
|
||||
g_free (msg);
|
||||
|
||||
@@ -10327,8 +10326,6 @@ shortcuts_activate_volume_mount_cb (GtkFileSystemHandle *handle,
|
||||
if (path != NULL)
|
||||
{
|
||||
change_folder_and_display_error (impl, path, FALSE);
|
||||
focus_browse_tree_view_if_possible (impl);
|
||||
|
||||
gtk_file_path_free (path);
|
||||
}
|
||||
|
||||
@@ -10407,14 +10404,11 @@ shortcuts_activate_get_info_cb (GtkFileSystemHandle *handle,
|
||||
|
||||
data->impl->shortcuts_activate_iter_handle = NULL;
|
||||
|
||||
if (cancelled)
|
||||
if (cancelled || g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_INTR))
|
||||
goto out;
|
||||
|
||||
if (!error && gtk_file_info_get_is_folder (info))
|
||||
{
|
||||
change_folder_and_display_error (data->impl, data->path, FALSE);
|
||||
focus_browse_tree_view_if_possible (data->impl);
|
||||
}
|
||||
change_folder_and_display_error (data->impl, data->path, FALSE);
|
||||
else
|
||||
gtk_file_chooser_default_select_path (GTK_FILE_CHOOSER (data->impl),
|
||||
data->path,
|
||||
@@ -10435,7 +10429,9 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
|
||||
gpointer col_data;
|
||||
ShortcutType shortcut_type;
|
||||
|
||||
if (impl->location_mode == LOCATION_MODE_FILENAME_ENTRY && impl->action != GTK_FILE_CHOOSER_ACTION_SAVE)
|
||||
if (impl->location_mode == LOCATION_MODE_FILENAME_ENTRY
|
||||
&& !(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|
||||
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
|
||||
_gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), "");
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), iter,
|
||||
@@ -10482,25 +10478,6 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
|
||||
}
|
||||
}
|
||||
|
||||
/* Callback used when a row in the shortcuts list is activated */
|
||||
static void
|
||||
shortcuts_row_activated_cb (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
GtkFileChooserDefault *impl)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GtkTreeIter child_iter;
|
||||
|
||||
if (!gtk_tree_model_get_iter (impl->shortcuts_pane_filter_model, &iter, path))
|
||||
return;
|
||||
|
||||
gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (impl->shortcuts_pane_filter_model),
|
||||
&child_iter,
|
||||
&iter);
|
||||
shortcuts_activate_iter (impl, &child_iter);
|
||||
}
|
||||
|
||||
/* Handler for GtkWidget::key-press-event on the shortcuts list */
|
||||
static gboolean
|
||||
shortcuts_key_press_event_cb (GtkWidget *widget,
|
||||
@@ -11026,6 +11003,11 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
|
||||
time_t time_mtime;
|
||||
gchar *date_str = NULL;
|
||||
gboolean sensitive = TRUE;
|
||||
#ifdef G_OS_WIN32
|
||||
const char *locale, *dot = NULL;
|
||||
gint64 codepage = -1;
|
||||
char charset[20];
|
||||
#endif
|
||||
|
||||
impl = data;
|
||||
|
||||
@@ -11144,11 +11126,48 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column,
|
||||
format = "%x"; /* Any other date */
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
/* g_locale_from_utf8() returns a string in the system
|
||||
* code-page, which is not always the same as that used by the C
|
||||
* library. For instance when running a GTK+ program with
|
||||
* LANG=ko on an English version of Windows, the system
|
||||
* code-page is 1252, but the code-page used by the C library is
|
||||
* 949. (It's GTK+ itself that sets the C library locale when it
|
||||
* notices the LANG environment variable. See gtkmain.c The
|
||||
* Microsoft C library doesn't look at any locale environment
|
||||
* variables.) We need to pass strftime() a string in the C
|
||||
* library's code-page. See bug #509885.
|
||||
*/
|
||||
locale = setlocale (LC_ALL, NULL);
|
||||
if (locale != NULL)
|
||||
dot = strchr (locale, '.');
|
||||
if (dot != NULL)
|
||||
{
|
||||
codepage = g_ascii_strtoll (dot+1, NULL, 10);
|
||||
|
||||
/* All codepages should fit in 16 bits AFAIK */
|
||||
if (codepage > 0 && codepage < 65536)
|
||||
{
|
||||
sprintf (charset, "CP%u", (guint) codepage);
|
||||
locale_format = g_convert (format, -1, charset, "UTF-8", NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
#else
|
||||
locale_format = g_locale_from_utf8 (format, -1, NULL, NULL, NULL);
|
||||
#endif
|
||||
if (locale_format != NULL &&
|
||||
strftime (buf, sizeof (buf), locale_format, &tm_mtime) != 0)
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
/* As above but in opposite direction... */
|
||||
if (codepage > 0 && codepage < 65536)
|
||||
date_str = g_convert (buf, -1, "UTF-8", charset, NULL, NULL, NULL);
|
||||
#else
|
||||
date_str = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (strftime (buf, sizeof (buf), locale_format, &tm_mtime) != 0)
|
||||
date_str = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
|
||||
else
|
||||
if (date_str == NULL)
|
||||
date_str = g_strdup (_("Unknown"));
|
||||
|
||||
g_free (locale_format);
|
||||
@@ -11279,7 +11298,6 @@ switch_to_shortcut (GtkFileChooserDefault *impl,
|
||||
g_assert_not_reached ();
|
||||
|
||||
shortcuts_activate_iter (impl, &iter);
|
||||
focus_browse_tree_view_if_possible (impl);
|
||||
}
|
||||
|
||||
/* Handler for the "home-folder" keybinding signal */
|
||||
|
||||
+36
-14
@@ -112,6 +112,15 @@ gtk_file_chooser_dialog_finalize (GObject *object)
|
||||
G_OBJECT_CLASS (gtk_file_chooser_dialog_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_stock_accept_response_id (int response_id)
|
||||
{
|
||||
return (response_id == GTK_RESPONSE_ACCEPT
|
||||
|| response_id == GTK_RESPONSE_OK
|
||||
|| response_id == GTK_RESPONSE_YES
|
||||
|| response_id == GTK_RESPONSE_APPLY);
|
||||
}
|
||||
|
||||
/* Callback used when the user activates a file in the file chooser widget */
|
||||
static void
|
||||
file_chooser_widget_file_activated (GtkFileChooser *chooser,
|
||||
@@ -135,10 +144,7 @@ file_chooser_widget_file_activated (GtkFileChooser *chooser,
|
||||
|
||||
widget = GTK_WIDGET (l->data);
|
||||
response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget);
|
||||
if (response_id == GTK_RESPONSE_ACCEPT
|
||||
|| response_id == GTK_RESPONSE_OK
|
||||
|| response_id == GTK_RESPONSE_YES
|
||||
|| response_id == GTK_RESPONSE_APPLY)
|
||||
if (is_stock_accept_response_id (response_id))
|
||||
{
|
||||
gtk_widget_activate (widget); /* Should we gtk_dialog_response (dialog, response_id) instead? */
|
||||
break;
|
||||
@@ -244,10 +250,7 @@ file_chooser_widget_response_requested (GtkWidget *widget,
|
||||
|
||||
widget = GTK_WIDGET (l->data);
|
||||
response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget);
|
||||
if (response_id == GTK_RESPONSE_ACCEPT
|
||||
|| response_id == GTK_RESPONSE_OK
|
||||
|| response_id == GTK_RESPONSE_YES
|
||||
|| response_id == GTK_RESPONSE_APPLY)
|
||||
if (is_stock_accept_response_id (response_id))
|
||||
{
|
||||
dialog->priv->response_requested = TRUE;
|
||||
gtk_widget_activate (widget); /* Should we gtk_dialog_response (dialog, response_id) instead? */
|
||||
@@ -383,6 +386,26 @@ set_default_size (GtkFileChooserDialog *dialog)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
foreach_ensure_default_response_cb (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GtkFileChooserDialog *dialog = GTK_FILE_CHOOSER_DIALOG (data);
|
||||
int response_id;
|
||||
|
||||
response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget);
|
||||
if (is_stock_accept_response_id (response_id))
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), response_id);
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_default_response (GtkFileChooserDialog *dialog)
|
||||
{
|
||||
gtk_container_foreach (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
|
||||
foreach_ensure_default_response_cb,
|
||||
dialog);
|
||||
}
|
||||
|
||||
/* GtkWidget::map handler */
|
||||
static void
|
||||
gtk_file_chooser_dialog_map (GtkWidget *widget)
|
||||
@@ -390,6 +413,8 @@ gtk_file_chooser_dialog_map (GtkWidget *widget)
|
||||
GtkFileChooserDialog *dialog = GTK_FILE_CHOOSER_DIALOG (widget);
|
||||
GtkFileChooserDialogPrivate *priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
|
||||
|
||||
ensure_default_response (dialog);
|
||||
|
||||
if (!GTK_WIDGET_MAPPED (priv->widget))
|
||||
gtk_widget_map (priv->widget);
|
||||
|
||||
@@ -427,12 +452,9 @@ response_cb (GtkDialog *dialog,
|
||||
priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
|
||||
|
||||
/* Act only on response IDs we recognize */
|
||||
if ((response_id == GTK_RESPONSE_ACCEPT ||
|
||||
response_id == GTK_RESPONSE_OK ||
|
||||
response_id == GTK_RESPONSE_YES ||
|
||||
response_id == GTK_RESPONSE_APPLY) &&
|
||||
!priv->response_requested &&
|
||||
!_gtk_file_chooser_embed_should_respond (GTK_FILE_CHOOSER_EMBED (priv->widget)))
|
||||
if (is_stock_accept_response_id (response_id)
|
||||
&& !priv->response_requested
|
||||
&& !_gtk_file_chooser_embed_should_respond (GTK_FILE_CHOOSER_EMBED (priv->widget)))
|
||||
{
|
||||
g_signal_stop_emission_by_name (dialog, "response");
|
||||
}
|
||||
|
||||
+121
-4
@@ -75,6 +75,7 @@ static void gtk_file_chooser_entry_iface_init (GtkEditableClass *iface);
|
||||
|
||||
static void gtk_file_chooser_entry_finalize (GObject *object);
|
||||
static void gtk_file_chooser_entry_dispose (GObject *object);
|
||||
static void gtk_file_chooser_entry_grab_focus (GtkWidget *widget);
|
||||
static gboolean gtk_file_chooser_entry_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction);
|
||||
static void gtk_file_chooser_entry_activate (GtkEntry *entry);
|
||||
@@ -86,6 +87,19 @@ static void gtk_file_chooser_entry_do_insert_text (GtkEditable *editable,
|
||||
|
||||
static void clear_completion_callback (GtkFileChooserEntry *chooser_entry,
|
||||
GParamSpec *pspec);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static gint insert_text_callback (GtkFileChooserEntry *widget,
|
||||
const gchar *new_text,
|
||||
gint new_text_length,
|
||||
gint *position,
|
||||
gpointer user_data);
|
||||
static void delete_text_callback (GtkFileChooserEntry *widget,
|
||||
gint start_pos,
|
||||
gint end_pos,
|
||||
gpointer user_data);
|
||||
#endif
|
||||
|
||||
static gboolean match_selected_callback (GtkEntryCompletion *completion,
|
||||
GtkTreeModel *model,
|
||||
GtkTreeIter *iter,
|
||||
@@ -120,6 +134,7 @@ _gtk_file_chooser_entry_class_init (GtkFileChooserEntryClass *class)
|
||||
gobject_class->finalize = gtk_file_chooser_entry_finalize;
|
||||
gobject_class->dispose = gtk_file_chooser_entry_dispose;
|
||||
|
||||
widget_class->grab_focus = gtk_file_chooser_entry_grab_focus;
|
||||
widget_class->focus = gtk_file_chooser_entry_focus;
|
||||
|
||||
entry_class->activate = gtk_file_chooser_entry_activate;
|
||||
@@ -167,6 +182,13 @@ _gtk_file_chooser_entry_init (GtkFileChooserEntry *chooser_entry)
|
||||
G_CALLBACK (clear_completion_callback), NULL);
|
||||
g_signal_connect (chooser_entry, "notify::selection-bound",
|
||||
G_CALLBACK (clear_completion_callback), NULL);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
g_signal_connect (chooser_entry, "insert_text",
|
||||
G_CALLBACK (insert_text_callback), NULL);
|
||||
g_signal_connect (chooser_entry, "delete_text",
|
||||
G_CALLBACK (delete_text_callback), NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -501,11 +523,9 @@ check_completion_callback (GtkFileChooserEntry *chooser_entry)
|
||||
{
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
g_assert (chooser_entry->file_part);
|
||||
|
||||
chooser_entry->check_completion_idle = 0;
|
||||
|
||||
if (strcmp (chooser_entry->file_part, "") == 0)
|
||||
if (chooser_entry->file_part == NULL || strcmp (chooser_entry->file_part, "") == 0)
|
||||
goto done;
|
||||
|
||||
/* We only insert the common prefix without requiring the user to hit Tab in
|
||||
@@ -696,6 +716,13 @@ gtk_file_chooser_entry_do_insert_text (GtkEditable *editable,
|
||||
add_completion_idle (GTK_FILE_CHOOSER_ENTRY (editable));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_file_chooser_entry_grab_focus (GtkWidget *widget)
|
||||
{
|
||||
GTK_WIDGET_CLASS (_gtk_file_chooser_entry_parent_class)->grab_focus (widget);
|
||||
_gtk_file_chooser_entry_select_filename (GTK_FILE_CHOOSER_ENTRY (widget));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_file_chooser_entry_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction)
|
||||
@@ -867,6 +894,70 @@ clear_completion_callback (GtkFileChooserEntry *chooser_entry,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static gint
|
||||
insert_text_callback (GtkFileChooserEntry *chooser_entry,
|
||||
const gchar *new_text,
|
||||
gint new_text_length,
|
||||
gint *position,
|
||||
gpointer user_data)
|
||||
{
|
||||
const gchar *colon = memchr (new_text, ':', new_text_length);
|
||||
gint i;
|
||||
|
||||
/* Disallow these characters altogether */
|
||||
for (i = 0; i < new_text_length; i++)
|
||||
{
|
||||
if (new_text[i] == '<' ||
|
||||
new_text[i] == '>' ||
|
||||
new_text[i] == '"' ||
|
||||
new_text[i] == '|' ||
|
||||
new_text[i] == '*' ||
|
||||
new_text[i] == '?')
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < new_text_length ||
|
||||
/* Disallow entering text that would cause a colon to be anywhere except
|
||||
* after a drive letter.
|
||||
*/
|
||||
(colon != NULL &&
|
||||
*position + (colon - new_text) != 1) ||
|
||||
(new_text_length > 0 &&
|
||||
*position <= 1 &&
|
||||
GTK_ENTRY (chooser_entry)->text_length >= 2 &&
|
||||
gtk_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':'))
|
||||
{
|
||||
gtk_widget_error_bell (GTK_WIDGET (chooser_entry));
|
||||
g_signal_stop_emission_by_name (chooser_entry, "insert_text");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
delete_text_callback (GtkFileChooserEntry *chooser_entry,
|
||||
gint start_pos,
|
||||
gint end_pos,
|
||||
gpointer user_data)
|
||||
{
|
||||
/* If deleting a drive letter, delete the colon, too */
|
||||
if (start_pos == 0 && end_pos == 1 &&
|
||||
GTK_ENTRY (chooser_entry)->text_length >= 2 &&
|
||||
gtk_entry_get_text (GTK_ENTRY (chooser_entry))[1] == ':')
|
||||
{
|
||||
g_signal_handlers_block_by_func (chooser_entry,
|
||||
G_CALLBACK (delete_text_callback),
|
||||
user_data);
|
||||
gtk_editable_delete_text (GTK_EDITABLE (chooser_entry), 0, 1);
|
||||
g_signal_handlers_unblock_by_func (chooser_entry,
|
||||
G_CALLBACK (delete_text_callback),
|
||||
user_data);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* _gtk_file_chooser_entry_new:
|
||||
* @eat_tabs: If %FALSE, allow focus navigation with the tab key.
|
||||
@@ -929,7 +1020,7 @@ _gtk_file_chooser_entry_set_base_folder (GtkFileChooserEntry *chooser_entry,
|
||||
chooser_entry->base_folder = gtk_file_path_copy (path);
|
||||
|
||||
gtk_file_chooser_entry_changed (GTK_EDITABLE (chooser_entry));
|
||||
gtk_editable_select_region (GTK_EDITABLE (chooser_entry), 0, -1);
|
||||
_gtk_file_chooser_entry_select_filename (chooser_entry);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1074,3 +1165,29 @@ _gtk_file_chooser_entry_get_is_folder (GtkFileChooserEntry *chooser_entry,
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* _gtk_file_chooser_entry_select_filename:
|
||||
* @chooser_entry: a #GtkFileChooserEntry
|
||||
*
|
||||
* Selects the filename (without the extension) for user edition.
|
||||
*/
|
||||
void
|
||||
_gtk_file_chooser_entry_select_filename (GtkFileChooserEntry *chooser_entry)
|
||||
{
|
||||
const gchar *str, *ext;
|
||||
glong len = -1;
|
||||
|
||||
if (chooser_entry->action == GTK_FILE_CHOOSER_ACTION_SAVE)
|
||||
{
|
||||
str = gtk_entry_get_text (GTK_ENTRY (chooser_entry));
|
||||
ext = g_strrstr (str, ".");
|
||||
|
||||
if (ext)
|
||||
len = g_utf8_pointer_to_offset (str, ext);
|
||||
}
|
||||
|
||||
gtk_editable_select_region (GTK_EDITABLE (chooser_entry), 0, (gint) len);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ const GtkFilePath *_gtk_file_chooser_entry_get_current_folder (GtkFileChooserEnt
|
||||
const gchar * _gtk_file_chooser_entry_get_file_part (GtkFileChooserEntry *chooser_entry);
|
||||
gboolean _gtk_file_chooser_entry_get_is_folder (GtkFileChooserEntry *chooser_entry,
|
||||
const GtkFilePath *path);
|
||||
void _gtk_file_chooser_entry_select_filename (GtkFileChooserEntry *chooser_entry);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
+2
-2
@@ -306,7 +306,7 @@ gtk_file_info_render_icon (const GtkFileInfo *info,
|
||||
pixbuf = gtk_widget_render_icon (widget,
|
||||
gtk_file_info_get_is_folder (info)
|
||||
? GTK_STOCK_DIRECTORY : GTK_STOCK_FILE,
|
||||
GTK_ICON_SIZE_SMALL_TOOLBAR,
|
||||
GTK_ICON_SIZE_MENU,
|
||||
NULL);
|
||||
if (!pixbuf && error)
|
||||
g_set_error (error,
|
||||
@@ -670,7 +670,7 @@ gtk_file_system_volume_render_icon (GtkFileSystem *file_system,
|
||||
if (!pixbuf)
|
||||
pixbuf = gtk_widget_render_icon (widget,
|
||||
GTK_STOCK_HARDDISK,
|
||||
GTK_ICON_SIZE_SMALL_TOOLBAR,
|
||||
GTK_ICON_SIZE_MENU,
|
||||
NULL);
|
||||
|
||||
return pixbuf;
|
||||
|
||||
@@ -914,6 +914,7 @@ gtk_file_system_unix_get_folder (GtkFileSystem *file_system,
|
||||
folder_unix->have_mime_type = FALSE;
|
||||
folder_unix->have_stat = FALSE;
|
||||
folder_unix->have_hidden = FALSE;
|
||||
folder_unix->is_finished_loading = FALSE;
|
||||
set_asof = TRUE;
|
||||
}
|
||||
|
||||
@@ -1469,10 +1470,11 @@ expand_tilde (const char *filename)
|
||||
home = passwd->pw_dir;
|
||||
}
|
||||
|
||||
/* We put G_DIR_SEPARATOR_S so that empty basenames will make the resulting path end in a slash */
|
||||
if (slash)
|
||||
return g_build_filename (home, G_DIR_SEPARATOR_S, slash + 1, NULL);
|
||||
else
|
||||
return g_strdup (home);
|
||||
return g_build_filename (home, G_DIR_SEPARATOR_S, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#undef STRICT
|
||||
#include <shlobj.h>
|
||||
#include <shellapi.h>
|
||||
#include <winreg.h>
|
||||
|
||||
#define BOOKMARKS_FILENAME ".gtk-bookmarks"
|
||||
|
||||
@@ -330,6 +331,65 @@ gtk_file_system_win32_iface_init (GtkFileSystemIface *iface)
|
||||
iface->set_bookmark_label = gtk_file_system_win32_set_bookmark_label;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_viewable_logical_drives:
|
||||
*
|
||||
* Returns the list of logical and viewable drives as defined by
|
||||
* GetLogicalDrives() and the registry keys
|
||||
* Software\Microsoft\Windows\CurrentVersion\Policies\Explorer under
|
||||
* HKLM or HKCU. If neither key exists the result of
|
||||
* GetLogicalDrives() is returned.
|
||||
*
|
||||
* Return value: bitmask with same meaning as returned by GetLogicalDrives()
|
||||
**/
|
||||
static guint32
|
||||
get_viewable_logical_drives (void)
|
||||
{
|
||||
guint viewable_drives = GetLogicalDrives ();
|
||||
HKEY key;
|
||||
|
||||
DWORD var_type = REG_DWORD; //the value's a REG_DWORD type
|
||||
DWORD no_drives_size = 4;
|
||||
DWORD no_drives;
|
||||
gboolean hklm_present = FALSE;
|
||||
|
||||
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE,
|
||||
"Software\\Microsoft\\Windows\\"
|
||||
"CurrentVersion\\Policies\\Explorer",
|
||||
0, KEY_READ, &key) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegQueryValueEx (key, "NoDrives", NULL, &var_type,
|
||||
(LPBYTE) &no_drives, &no_drives_size) == ERROR_SUCCESS)
|
||||
{
|
||||
/* We need the bits that are set in viewable_drives, and
|
||||
* unset in no_drives.
|
||||
*/
|
||||
viewable_drives = viewable_drives & ~no_drives;
|
||||
hklm_present = TRUE;
|
||||
}
|
||||
RegCloseKey (key);
|
||||
}
|
||||
|
||||
/* If the key is present in HKLM then the one in HKCU should be ignored */
|
||||
if (!hklm_present)
|
||||
{
|
||||
if (RegOpenKeyEx (HKEY_CURRENT_USER,
|
||||
"Software\\Microsoft\\Windows\\"
|
||||
"CurrentVersion\\Policies\\Explorer",
|
||||
0, KEY_READ, &key) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegQueryValueEx (key, "NoDrives", NULL, &var_type,
|
||||
(LPBYTE) &no_drives, &no_drives_size) == ERROR_SUCCESS)
|
||||
{
|
||||
viewable_drives = viewable_drives & ~no_drives;
|
||||
}
|
||||
RegCloseKey (key);
|
||||
}
|
||||
}
|
||||
|
||||
return viewable_drives;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
check_volumes (gpointer data)
|
||||
{
|
||||
@@ -337,10 +397,10 @@ check_volumes (gpointer data)
|
||||
|
||||
g_return_val_if_fail (system_win32, FALSE);
|
||||
|
||||
if (system_win32->drives != GetLogicalDrives())
|
||||
{
|
||||
g_signal_emit_by_name (system_win32, "volumes-changed", 0);
|
||||
}
|
||||
if (system_win32->drives != get_viewable_logical_drives ())
|
||||
{
|
||||
g_signal_emit_by_name (system_win32, "volumes-changed", 0);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -527,11 +587,11 @@ gtk_file_system_win32_list_volumes (GtkFileSystem *file_system)
|
||||
GSList *list = NULL;
|
||||
GtkFileSystemWin32 *system_win32 = (GtkFileSystemWin32 *)file_system;
|
||||
|
||||
drives = GetLogicalDrives();
|
||||
drives = get_viewable_logical_drives ();
|
||||
|
||||
system_win32->drives = drives;
|
||||
if (!drives)
|
||||
g_warning ("GetLogicalDrives failed.");
|
||||
g_warning ("get_viewable_logical_drives failed.");
|
||||
|
||||
while (drives && drive[0] <= 'Z')
|
||||
{
|
||||
|
||||
+56
-13
@@ -396,6 +396,8 @@ static void gtk_icon_view_item_activate_cell (GtkIco
|
||||
GtkIconViewItem *item,
|
||||
GtkIconViewCellInfo *cell_info,
|
||||
GdkEvent *event);
|
||||
static void gtk_icon_view_item_selected_changed (GtkIconView *icon_view,
|
||||
GtkIconViewItem *item);
|
||||
static void gtk_icon_view_put (GtkIconView *icon_view,
|
||||
GtkWidget *widget,
|
||||
GtkIconViewItem *item,
|
||||
@@ -870,9 +872,13 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
|
||||
"unselect_all", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
|
||||
"toggle_cursor_item", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK,
|
||||
"toggle_cursor_item", 0);
|
||||
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
|
||||
"activate_cursor_item", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
|
||||
"activate_cursor_item", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_Return, 0,
|
||||
"activate_cursor_item", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0,
|
||||
@@ -1669,6 +1675,25 @@ gtk_icon_view_item_activate_cell (GtkIconView *icon_view,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_icon_view_item_selected_changed (GtkIconView *icon_view,
|
||||
GtkIconViewItem *item)
|
||||
{
|
||||
AtkObject *obj;
|
||||
AtkObject *item_obj;
|
||||
|
||||
obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
|
||||
if (obj != NULL)
|
||||
{
|
||||
item_obj = atk_object_ref_accessible_child (obj, item->index);
|
||||
if (item_obj != NULL)
|
||||
{
|
||||
atk_object_notify_state_change (item_obj, ATK_STATE_SELECTED, item->selected);
|
||||
g_object_unref (item_obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_icon_view_put (GtkIconView *icon_view,
|
||||
GtkWidget *widget,
|
||||
@@ -2323,6 +2348,7 @@ gtk_icon_view_unselect_all_internal (GtkIconView *icon_view)
|
||||
item->selected = FALSE;
|
||||
dirty = TRUE;
|
||||
gtk_icon_view_queue_draw_item (icon_view, item);
|
||||
gtk_icon_view_item_selected_changed (icon_view, item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2471,6 +2497,7 @@ gtk_icon_view_real_toggle_cursor_item (GtkIconView *icon_view)
|
||||
icon_view->priv->cursor_item->selected = !icon_view->priv->cursor_item->selected;
|
||||
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
||||
|
||||
gtk_icon_view_item_selected_changed (icon_view, icon_view->priv->cursor_item);
|
||||
gtk_icon_view_queue_draw_item (icon_view, icon_view->priv->cursor_item);
|
||||
break;
|
||||
}
|
||||
@@ -3215,14 +3242,23 @@ gtk_icon_view_set_cursor_item (GtkIconView *icon_view,
|
||||
{
|
||||
AtkObject *obj;
|
||||
AtkObject *item_obj;
|
||||
AtkObject *cursor_item_obj;
|
||||
|
||||
if (icon_view->priv->cursor_item == item &&
|
||||
(cursor_cell < 0 || cursor_cell == icon_view->priv->cursor_cell))
|
||||
return;
|
||||
|
||||
obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
|
||||
if (icon_view->priv->cursor_item != NULL)
|
||||
gtk_icon_view_queue_draw_item (icon_view, icon_view->priv->cursor_item);
|
||||
|
||||
{
|
||||
gtk_icon_view_queue_draw_item (icon_view, icon_view->priv->cursor_item);
|
||||
if (obj != NULL)
|
||||
{
|
||||
cursor_item_obj = atk_object_ref_accessible_child (obj, icon_view->priv->cursor_item->index);
|
||||
if (cursor_item_obj != NULL)
|
||||
atk_object_notify_state_change (cursor_item_obj, ATK_STATE_FOCUSED, FALSE);
|
||||
}
|
||||
}
|
||||
icon_view->priv->cursor_item = item;
|
||||
if (cursor_cell >= 0)
|
||||
icon_view->priv->cursor_cell = cursor_cell;
|
||||
@@ -3230,12 +3266,12 @@ gtk_icon_view_set_cursor_item (GtkIconView *icon_view,
|
||||
gtk_icon_view_queue_draw_item (icon_view, item);
|
||||
|
||||
/* Notify that accessible focus object has changed */
|
||||
obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
|
||||
item_obj = atk_object_ref_accessible_child (obj, item->index);
|
||||
|
||||
if (item_obj != NULL)
|
||||
{
|
||||
atk_focus_tracker_notify (item_obj);
|
||||
atk_object_notify_state_change (item_obj, ATK_STATE_FOCUSED, TRUE);
|
||||
g_object_unref (item_obj);
|
||||
}
|
||||
}
|
||||
@@ -3342,9 +3378,10 @@ gtk_icon_view_select_item (GtkIconView *icon_view,
|
||||
|
||||
item->selected = TRUE;
|
||||
|
||||
gtk_icon_view_queue_draw_item (icon_view, item);
|
||||
|
||||
gtk_icon_view_item_selected_changed (icon_view, item);
|
||||
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
||||
|
||||
gtk_icon_view_queue_draw_item (icon_view, item);
|
||||
}
|
||||
|
||||
|
||||
@@ -3364,6 +3401,7 @@ gtk_icon_view_unselect_item (GtkIconView *icon_view,
|
||||
|
||||
item->selected = FALSE;
|
||||
|
||||
gtk_icon_view_item_selected_changed (icon_view, item);
|
||||
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
||||
|
||||
gtk_icon_view_queue_draw_item (icon_view, item);
|
||||
@@ -3861,10 +3899,11 @@ gtk_icon_view_select_all_between (GtkIconView *icon_view,
|
||||
col1 <= item->col && item->col <= col2)
|
||||
{
|
||||
if (!item->selected)
|
||||
dirty = TRUE;
|
||||
|
||||
item->selected = TRUE;
|
||||
|
||||
{
|
||||
dirty = TRUE;
|
||||
item->selected = TRUE;
|
||||
gtk_icon_view_item_selected_changed (icon_view, item);
|
||||
}
|
||||
gtk_icon_view_queue_draw_item (icon_view, item);
|
||||
}
|
||||
}
|
||||
@@ -4484,8 +4523,8 @@ gtk_icon_view_cell_layout_reorder (GtkCellLayout *layout,
|
||||
|
||||
g_return_if_fail (link != NULL);
|
||||
|
||||
icon_view->priv->cell_list = g_list_remove_link (icon_view->priv->cell_list,
|
||||
link);
|
||||
icon_view->priv->cell_list = g_list_delete_link (icon_view->priv->cell_list,
|
||||
link);
|
||||
icon_view->priv->cell_list = g_list_insert (icon_view->priv->cell_list,
|
||||
info, position);
|
||||
|
||||
@@ -6581,7 +6620,7 @@ gtk_icon_view_drag_data_get (GtkWidget *widget,
|
||||
if (model == NULL)
|
||||
return;
|
||||
|
||||
if (!icon_view->priv->dest_set)
|
||||
if (!icon_view->priv->source_set)
|
||||
return;
|
||||
|
||||
source_row = get_source_row (context);
|
||||
@@ -6624,7 +6663,7 @@ gtk_icon_view_drag_data_delete (GtkWidget *widget,
|
||||
if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_SOURCE, "drag_data_delete"))
|
||||
return;
|
||||
|
||||
if (!icon_view->priv->dest_set)
|
||||
if (!icon_view->priv->source_set)
|
||||
return;
|
||||
|
||||
source_row = get_source_row (context);
|
||||
@@ -8493,6 +8532,10 @@ gtk_icon_view_item_accessible_ref_state_set (AtkObject *obj)
|
||||
atk_state_set_add_state (item->state_set, ATK_STATE_FOCUSED);
|
||||
else
|
||||
atk_state_set_remove_state (item->state_set, ATK_STATE_FOCUSED);
|
||||
if (item->item->selected)
|
||||
atk_state_set_add_state (item->state_set, ATK_STATE_SELECTED);
|
||||
else
|
||||
atk_state_set_remove_state (item->state_set, ATK_STATE_SELECTED);
|
||||
|
||||
return g_object_ref (item->state_set);
|
||||
}
|
||||
|
||||
+10
-8
@@ -1342,6 +1342,7 @@ static gint
|
||||
animation_timeout (gpointer data)
|
||||
{
|
||||
GtkImage *image;
|
||||
int delay;
|
||||
|
||||
image = GTK_IMAGE (data);
|
||||
|
||||
@@ -1349,16 +1350,17 @@ animation_timeout (gpointer data)
|
||||
|
||||
gdk_pixbuf_animation_iter_advance (image->data.anim.iter, NULL);
|
||||
|
||||
if (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter) >= 0)
|
||||
image->data.anim.frame_timeout =
|
||||
gdk_threads_add_timeout (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter),
|
||||
animation_timeout,
|
||||
image);
|
||||
delay = gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter);
|
||||
if (delay >= 0)
|
||||
{
|
||||
image->data.anim.frame_timeout =
|
||||
gdk_threads_add_timeout (delay, animation_timeout, image);
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (image));
|
||||
gtk_widget_queue_draw (GTK_WIDGET (image));
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (image))
|
||||
gdk_window_process_updates (GTK_WIDGET (image)->window, TRUE);
|
||||
if (GTK_WIDGET_DRAWABLE (image))
|
||||
gdk_window_process_updates (GTK_WIDGET (image)->window, TRUE);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1012,6 +1012,7 @@ gtk_im_context_simple_commit_char (GtkIMContext *context,
|
||||
context_simple->tentative_match = 0;
|
||||
context_simple->tentative_match_len = 0;
|
||||
g_signal_emit_by_name (context_simple, "preedit_changed");
|
||||
g_signal_emit_by_name (context_simple, "preedit_end");
|
||||
}
|
||||
|
||||
g_signal_emit_by_name (context, "commit", &buf);
|
||||
@@ -1355,6 +1356,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
context_simple->compose_buffer[0] = 0;
|
||||
|
||||
g_signal_emit_by_name (context_simple, "preedit_changed");
|
||||
g_signal_emit_by_name (context_simple, "preedit_end");
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -1364,7 +1366,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
}
|
||||
|
||||
/* Ignore modifier key presses */
|
||||
for (i=0; i < G_N_ELEMENTS (gtk_compose_ignore); i++)
|
||||
for (i = 0; i < G_N_ELEMENTS (gtk_compose_ignore); i++)
|
||||
if (event->keyval == gtk_compose_ignore[i])
|
||||
return FALSE;
|
||||
|
||||
@@ -1417,6 +1419,9 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
}
|
||||
|
||||
g_signal_emit_by_name (context_simple, "preedit_changed");
|
||||
|
||||
if (!context_simple->in_hex_sequence)
|
||||
g_signal_emit_by_name (context_simple, "preedit_end");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1450,6 +1455,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
context_simple->modifiers_dropped = FALSE;
|
||||
context_simple->tentative_match = 0;
|
||||
|
||||
g_signal_emit_by_name (context_simple, "preedit_start");
|
||||
g_signal_emit_by_name (context_simple, "preedit_changed");
|
||||
|
||||
return TRUE;
|
||||
@@ -1508,6 +1514,9 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
|
||||
g_signal_emit_by_name (context_simple, "preedit_changed");
|
||||
|
||||
if (!context_simple->in_hex_sequence)
|
||||
g_signal_emit_by_name (context_simple, "preedit_end");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1542,6 +1551,7 @@ gtk_im_context_simple_reset (GtkIMContext *context)
|
||||
context_simple->tentative_match = 0;
|
||||
context_simple->tentative_match_len = 0;
|
||||
g_signal_emit_by_name (context_simple, "preedit_changed");
|
||||
g_signal_emit_by_name (context_simple, "preedit_end");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-24
@@ -1213,6 +1213,8 @@ gtk_label_set_attributes_internal (GtkLabel *label,
|
||||
static void
|
||||
gtk_label_recalculate (GtkLabel *label)
|
||||
{
|
||||
guint keyval = label->mnemonic_keyval;
|
||||
|
||||
if (label->use_markup)
|
||||
set_markup (label, label->label, label->use_underline);
|
||||
else
|
||||
@@ -1231,11 +1233,12 @@ gtk_label_recalculate (GtkLabel *label)
|
||||
}
|
||||
|
||||
if (!label->use_underline)
|
||||
{
|
||||
guint keyval = label->mnemonic_keyval;
|
||||
label->mnemonic_keyval = GDK_VoidSymbol;
|
||||
|
||||
label->mnemonic_keyval = GDK_VoidSymbol;
|
||||
if (keyval != label->mnemonic_keyval)
|
||||
{
|
||||
gtk_label_setup_mnemonic (label, keyval);
|
||||
g_object_notify (G_OBJECT (label), "mnemonic-keyval");
|
||||
}
|
||||
|
||||
gtk_label_clear_layout (label);
|
||||
@@ -1326,19 +1329,13 @@ void
|
||||
gtk_label_set_label (GtkLabel *label,
|
||||
const gchar *str)
|
||||
{
|
||||
guint last_keyval;
|
||||
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
g_return_if_fail (str != NULL);
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (label));
|
||||
|
||||
last_keyval = label->mnemonic_keyval;
|
||||
|
||||
gtk_label_set_label_internal (label, g_strdup (str));
|
||||
gtk_label_recalculate (label);
|
||||
if (last_keyval != label->mnemonic_keyval)
|
||||
gtk_label_setup_mnemonic (label, last_keyval);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (label));
|
||||
}
|
||||
@@ -1454,18 +1451,15 @@ void
|
||||
gtk_label_set_markup_with_mnemonic (GtkLabel *label,
|
||||
const gchar *str)
|
||||
{
|
||||
guint last_keyval;
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (label));
|
||||
|
||||
last_keyval = label->mnemonic_keyval;
|
||||
gtk_label_set_label_internal (label, g_strdup (str ? str : ""));
|
||||
gtk_label_set_use_markup_internal (label, TRUE);
|
||||
gtk_label_set_use_underline_internal (label, TRUE);
|
||||
|
||||
gtk_label_recalculate (label);
|
||||
gtk_label_setup_mnemonic (label, last_keyval);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (label));
|
||||
}
|
||||
@@ -2672,13 +2666,10 @@ gtk_label_parse_uline (GtkLabel *label,
|
||||
const gchar *str)
|
||||
{
|
||||
guint keyval;
|
||||
guint orig_keyval;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_LABEL (label), GDK_VoidSymbol);
|
||||
g_return_val_if_fail (str != NULL, GDK_VoidSymbol);
|
||||
|
||||
orig_keyval = label->mnemonic_keyval;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (label));
|
||||
|
||||
gtk_label_set_label_internal (label, g_strdup (str ? str : ""));
|
||||
@@ -2688,9 +2679,12 @@ gtk_label_parse_uline (GtkLabel *label,
|
||||
gtk_label_recalculate (label);
|
||||
|
||||
keyval = label->mnemonic_keyval;
|
||||
label->mnemonic_keyval = GDK_VoidSymbol;
|
||||
|
||||
gtk_label_setup_mnemonic (label, orig_keyval);
|
||||
if (keyval != GDK_VoidSymbol)
|
||||
{
|
||||
label->mnemonic_keyval = GDK_VoidSymbol;
|
||||
gtk_label_setup_mnemonic (label, keyval);
|
||||
g_object_notify (G_OBJECT (label), "mnemonic-keyval");
|
||||
}
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (label));
|
||||
|
||||
@@ -2717,8 +2711,6 @@ gtk_label_set_text_with_mnemonic (GtkLabel *label,
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
g_return_if_fail (str != NULL);
|
||||
|
||||
last_keyval = label->mnemonic_keyval;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (label));
|
||||
|
||||
gtk_label_set_label_internal (label, g_strdup (str ? str : ""));
|
||||
@@ -2727,8 +2719,6 @@ gtk_label_set_text_with_mnemonic (GtkLabel *label,
|
||||
|
||||
gtk_label_recalculate (label);
|
||||
|
||||
gtk_label_setup_mnemonic (label, last_keyval);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (label));
|
||||
}
|
||||
|
||||
@@ -3672,8 +3662,6 @@ gtk_label_set_use_underline (GtkLabel *label,
|
||||
|
||||
gtk_label_set_use_underline_internal (label, setting);
|
||||
gtk_label_recalculate (label);
|
||||
if (label->use_underline)
|
||||
gtk_label_setup_mnemonic (label, label->mnemonic_keyval);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
-1
@@ -599,7 +599,11 @@ gtk_link_button_set_uri (GtkLinkButton *link_button,
|
||||
link_button->priv->uri = g_strdup (uri);
|
||||
g_free (tmp);
|
||||
|
||||
link_button->priv->visited = FALSE;
|
||||
if (link_button->priv->visited)
|
||||
{
|
||||
link_button->priv->visited = FALSE;
|
||||
set_link_color (link_button);
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (link_button), "uri");
|
||||
}
|
||||
|
||||
+23
-7
@@ -2072,8 +2072,11 @@ list_store_start_element (GMarkupParseContext *context,
|
||||
int i, id = -1;
|
||||
|
||||
if (data->row_column >= data->n_columns)
|
||||
g_set_error (error, data->error_quark, 0,
|
||||
"Too many columns, maximum is %d\n", data->n_columns - 1);
|
||||
{
|
||||
g_set_error (error, data->error_quark, 0,
|
||||
"Too many columns, maximum is %d\n", data->n_columns - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; names[i]; i++)
|
||||
if (strcmp (names[i], "id") == 0)
|
||||
@@ -2081,13 +2084,26 @@ list_store_start_element (GMarkupParseContext *context,
|
||||
errno = 0;
|
||||
id = atoi (values[i]);
|
||||
if (errno)
|
||||
g_set_error (error, data->error_quark, 0,
|
||||
"the id tag %s could not be converted to an integer", values[i]);
|
||||
{
|
||||
g_set_error (error, data->error_quark, 0,
|
||||
"the id tag %s could not be converted to an integer",
|
||||
values[i]);
|
||||
return;
|
||||
}
|
||||
if (id < 0 || id >= data->n_columns)
|
||||
{
|
||||
g_set_error (error, data->error_quark, 0,
|
||||
"id value %d out of range", id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (id == -1)
|
||||
g_set_error (error, data->error_quark, 0,
|
||||
"<col> needs an id attribute");
|
||||
{
|
||||
g_set_error (error, data->error_quark, 0,
|
||||
"<col> needs an id attribute");
|
||||
return;
|
||||
}
|
||||
|
||||
data->columns[data->row_column] = id;
|
||||
data->row_column++;
|
||||
@@ -2189,7 +2205,7 @@ list_store_text (GMarkupParseContext *context,
|
||||
gint i;
|
||||
GError *tmp_error = NULL;
|
||||
gchar *string;
|
||||
|
||||
|
||||
if (!data->is_data)
|
||||
return;
|
||||
|
||||
|
||||
+42
-24
@@ -67,12 +67,52 @@
|
||||
#include "gtkwidget.h"
|
||||
#include "gtkwindow.h"
|
||||
#include "gtktooltip.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkdebug.h"
|
||||
#include "gtkalias.h"
|
||||
|
||||
#include "gdk/gdkprivate.h" /* for GDK_WINDOW_DESTROYED */
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
|
||||
|
||||
/* This here before inclusion of gtkprivate.h so that it sees the
|
||||
* original GTK_LOCALEDIR definition. Yeah, this is a bit sucky.
|
||||
*/
|
||||
const gchar *
|
||||
_gtk_get_localedir (void)
|
||||
{
|
||||
static char *gtk_localedir = NULL;
|
||||
if (gtk_localedir == NULL)
|
||||
{
|
||||
const gchar *p;
|
||||
gchar *temp;
|
||||
|
||||
/* GTK_LOCALEDIR ends in either /lib/locale or
|
||||
* /share/locale. Scan for that slash.
|
||||
*/
|
||||
p = GTK_LOCALEDIR + strlen (GTK_LOCALEDIR);
|
||||
while (*--p != '/')
|
||||
;
|
||||
while (*--p != '/')
|
||||
;
|
||||
|
||||
temp = g_win32_get_package_installation_subdirectory
|
||||
(GETTEXT_PACKAGE, dll_name, p);
|
||||
|
||||
/* gtk_localedir is passed to bindtextdomain() which isn't
|
||||
* UTF-8-aware.
|
||||
*/
|
||||
gtk_localedir = g_win32_locale_filename_from_utf8 (temp);
|
||||
g_free (temp);
|
||||
}
|
||||
return gtk_localedir;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#include "gtkprivate.h"
|
||||
|
||||
/* Private type definitions
|
||||
*/
|
||||
typedef struct _GtkInitFunction GtkInitFunction;
|
||||
@@ -268,8 +308,6 @@ check_setugid (void)
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
|
||||
|
||||
const gchar *
|
||||
_gtk_get_datadir (void)
|
||||
{
|
||||
@@ -292,26 +330,6 @@ _gtk_get_libdir (void)
|
||||
return gtk_libdir;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
_gtk_get_localedir (void)
|
||||
{
|
||||
static char *gtk_localedir = NULL;
|
||||
if (gtk_localedir == NULL)
|
||||
{
|
||||
gchar *temp;
|
||||
|
||||
temp = g_win32_get_package_installation_subdirectory
|
||||
(GETTEXT_PACKAGE, dll_name, "lib\\locale");
|
||||
|
||||
/* gtk_localedir is passed to bindtextdomain() which isn't
|
||||
* UTF-8-aware.
|
||||
*/
|
||||
gtk_localedir = g_win32_locale_filename_from_utf8 (temp);
|
||||
g_free (temp);
|
||||
}
|
||||
return gtk_localedir;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
_gtk_get_sysconfdir (void)
|
||||
{
|
||||
@@ -731,7 +749,7 @@ post_parse_hook (GOptionContext *context,
|
||||
* with g_option_context_add_group(), if you are using
|
||||
* g_option_context_parse() to parse your commandline arguments.
|
||||
*
|
||||
* Returns a #GOptionGroup for the commandline arguments recognized
|
||||
* Returns: a #GOptionGroup for the commandline arguments recognized
|
||||
* by GTK+
|
||||
*
|
||||
* Since: 2.6
|
||||
|
||||
@@ -324,6 +324,11 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
|
||||
"activate_current", 1,
|
||||
G_TYPE_BOOLEAN,
|
||||
TRUE);
|
||||
gtk_binding_entry_add_signal (binding_set,
|
||||
GDK_ISO_Enter, 0,
|
||||
"activate_current", 1,
|
||||
G_TYPE_BOOLEAN,
|
||||
TRUE);
|
||||
gtk_binding_entry_add_signal (binding_set,
|
||||
GDK_KP_Enter, 0,
|
||||
"activate_current", 1,
|
||||
|
||||
+31
-15
@@ -212,6 +212,8 @@ static void gtk_notebook_move_focus_out (GtkNotebook *notebook,
|
||||
static gboolean gtk_notebook_reorder_tab (GtkNotebook *notebook,
|
||||
GtkDirectionType direction_type,
|
||||
gboolean move_to_last);
|
||||
static void gtk_notebook_remove_tab_label (GtkNotebook *notebook,
|
||||
GtkNotebookPage *page);
|
||||
|
||||
/*** GtkObject Methods ***/
|
||||
static void gtk_notebook_destroy (GtkObject *object);
|
||||
@@ -350,6 +352,8 @@ static GList * gtk_notebook_search_page (GtkNotebook *notebook,
|
||||
GList *list,
|
||||
gint direction,
|
||||
gboolean find_visible);
|
||||
static void gtk_notebook_child_reordered (GtkNotebook *notebook,
|
||||
GtkNotebookPage *page);
|
||||
|
||||
/*** GtkNotebook Drawing Functions ***/
|
||||
static void gtk_notebook_paint (GtkWidget *widget,
|
||||
@@ -1453,7 +1457,7 @@ gtk_notebook_destroy (GtkObject *object)
|
||||
{
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK (object);
|
||||
GtkNotebookPrivate *priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
|
||||
|
||||
|
||||
if (notebook->menu)
|
||||
gtk_notebook_popup_disable (notebook);
|
||||
|
||||
@@ -2725,7 +2729,6 @@ hide_drag_window (GtkNotebook *notebook,
|
||||
else
|
||||
gtk_widget_unparent (page->tab_label);
|
||||
|
||||
gtk_widget_set_parent_window (page->tab_label, widget->window);
|
||||
gtk_widget_set_parent (page->tab_label, widget);
|
||||
g_object_unref (page->tab_label);
|
||||
}
|
||||
@@ -2748,7 +2751,7 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
|
||||
else
|
||||
page = notebook->cur_page;
|
||||
|
||||
if (!page)
|
||||
if (!page || !page->tab_label)
|
||||
return;
|
||||
|
||||
priv->pressed_button = -1;
|
||||
@@ -2763,7 +2766,8 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
|
||||
element = get_drop_position (notebook, page->pack);
|
||||
old_page_num = g_list_position (notebook->children, notebook->focus_tab);
|
||||
page_num = reorder_tab (notebook, element, notebook->focus_tab);
|
||||
|
||||
gtk_notebook_child_reordered (notebook, page);
|
||||
|
||||
if (priv->has_scrolled || old_page_num != page_num)
|
||||
g_signal_emit (notebook,
|
||||
notebook_signals[PAGE_REORDERED], 0,
|
||||
@@ -4311,6 +4315,7 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
|
||||
GtkNotebookPage *page;
|
||||
GList * next_list;
|
||||
gint need_resize = FALSE;
|
||||
GtkWidget *tab_label;
|
||||
|
||||
gboolean destroying;
|
||||
|
||||
@@ -4345,8 +4350,16 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
|
||||
|
||||
gtk_widget_unparent (page->child);
|
||||
|
||||
gtk_notebook_remove_tab_label (notebook, page);
|
||||
|
||||
tab_label = page->tab_label;
|
||||
if (tab_label)
|
||||
{
|
||||
g_object_ref (tab_label);
|
||||
gtk_notebook_remove_tab_label (notebook, page);
|
||||
if (destroying)
|
||||
gtk_widget_destroy (tab_label);
|
||||
g_object_unref (tab_label);
|
||||
}
|
||||
|
||||
if (notebook->menu)
|
||||
{
|
||||
gtk_container_remove (GTK_CONTAINER (notebook->menu),
|
||||
@@ -4380,6 +4393,9 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
|
||||
gchar string[32];
|
||||
gint page_num = 1;
|
||||
|
||||
if (!notebook->show_tabs && !notebook->menu)
|
||||
return;
|
||||
|
||||
for (list = gtk_notebook_search_page (notebook, NULL, STEP_NEXT, FALSE);
|
||||
list;
|
||||
list = gtk_notebook_search_page (notebook, list, STEP_NEXT, FALSE))
|
||||
@@ -6947,10 +6963,10 @@ gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
|
||||
* Retrieves the text of the tab label for the page containing
|
||||
* @child.
|
||||
*
|
||||
* Returns value: the text of the tab label, or %NULL if the
|
||||
* tab label widget is not a #GtkLabel. The
|
||||
* string is owned by the widget and must not
|
||||
* be freed.
|
||||
* Return value: the text of the tab label, or %NULL if the
|
||||
* tab label widget is not a #GtkLabel. The
|
||||
* string is owned by the widget and must not
|
||||
* be freed.
|
||||
**/
|
||||
G_CONST_RETURN gchar *
|
||||
gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
|
||||
@@ -7081,11 +7097,11 @@ gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
|
||||
* Retrieves the text of the menu label for the page containing
|
||||
* @child.
|
||||
*
|
||||
* Returns value: the text of the tab label, or %NULL if the
|
||||
* widget does not have a menu label other than
|
||||
* the default menu label, or the menu label widget
|
||||
* is not a #GtkLabel. The string is owned by
|
||||
* the widget and must not be freed.
|
||||
* Return value: the text of the tab label, or %NULL if the
|
||||
* widget does not have a menu label other than
|
||||
* the default menu label, or the menu label widget
|
||||
* is not a #GtkLabel. The string is owned by
|
||||
* the widget and must not be freed.
|
||||
**/
|
||||
G_CONST_RETURN gchar *
|
||||
gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
|
||||
|
||||
@@ -113,6 +113,7 @@ gtk_page_setup_copy (GtkPageSetup *other)
|
||||
|
||||
copy = gtk_page_setup_new ();
|
||||
copy->orientation = other->orientation;
|
||||
gtk_paper_size_free (copy->paper_size);
|
||||
copy->paper_size = gtk_paper_size_copy (other->paper_size);
|
||||
copy->top_margin = other->top_margin;
|
||||
copy->bottom_margin = other->bottom_margin;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user