Compare commits
233 Commits
stack
...
GTK_2_12_9
| Author | SHA1 | Date | |
|---|---|---|---|
| 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.9 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.9.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-2.12.9 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK+
|
||||
[ Become root if necessary ]
|
||||
|
||||
@@ -1,3 +1,222 @@
|
||||
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.9. 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], [9])
|
||||
m4_define([gtk_version],
|
||||
[gtk_major_version.gtk_minor_version.gtk_micro_version])
|
||||
m4_define([gtk_interface_age], [2])
|
||||
m4_define([gtk_interface_age], [9])
|
||||
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 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,35 @@
|
||||
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 ===
|
||||
|
||||
@@ -1,3 +1,46 @@
|
||||
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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,63 @@
|
||||
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
|
||||
|
||||
@@ -975,6 +975,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 *
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,9 +176,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setBounds:(NSRect)bounds
|
||||
-(void)setFrame:(NSRect)frame
|
||||
{
|
||||
[super setBounds:bounds];
|
||||
[super setFrame:frame];
|
||||
[self updateTrackingRect];
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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,64 @@ 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 (void)
|
||||
{
|
||||
NSPoint point;
|
||||
gint x;
|
||||
gint y;
|
||||
GdkWindow *mouse_window;
|
||||
GdkWindowImplQuartz *impl;
|
||||
guint flags = 0;
|
||||
NSTimeInterval timestamp = 0;
|
||||
NSEvent *current_event;
|
||||
NSEvent *nsevent;
|
||||
|
||||
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 == _gdk_root)
|
||||
return;
|
||||
|
||||
/* NSMouseEntered always happens on the toplevel. */
|
||||
mouse_window = gdk_window_get_toplevel (mouse_window);
|
||||
|
||||
get_converted_window_coordinates (_gdk_root,
|
||||
x, y,
|
||||
mouse_window,
|
||||
&x, &y);
|
||||
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (mouse_window)->impl);
|
||||
|
||||
/* 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];
|
||||
}
|
||||
|
||||
nsevent = [NSEvent otherEventWithType:NSApplicationDefined
|
||||
location:NSMakePoint(x, impl->height - y)
|
||||
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 +1230,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 +1239,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 +1497,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);
|
||||
@@ -1777,6 +1840,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 +1859,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 +1894,15 @@ 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))
|
||||
[NSApp sendEvent:event];
|
||||
|
||||
_gdk_quartz_event_loop_release_event (event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,8 +144,14 @@ 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);
|
||||
|
||||
/* 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 +159,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(void);
|
||||
|
||||
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,
|
||||
|
||||
+192
-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
|
||||
@@ -442,6 +464,87 @@ 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)
|
||||
{
|
||||
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;
|
||||
static NSRect old_rect;
|
||||
NSRect rect;
|
||||
|
||||
if (window == _gdk_root)
|
||||
return;
|
||||
|
||||
if (window == 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 &&
|
||||
rect.origin.x == old_rect.origin.x &&
|
||||
rect.origin.y == old_rect.origin.y &&
|
||||
rect.size.width == old_rect.size.width &&
|
||||
rect.size.height == old_rect.size.height)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
old_rect = rect;
|
||||
|
||||
if (debug_window)
|
||||
[debug_window close];
|
||||
|
||||
debug_window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:NSBorderlessWindowMask
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
|
||||
[debug_window setBackgroundColor:[NSColor redColor]];
|
||||
[debug_window setAlphaValue:0.4];
|
||||
[debug_window setOpaque:NO];
|
||||
[debug_window setReleasedWhenClosed:YES];
|
||||
[debug_window setIgnoresMouseEvents:YES];
|
||||
[debug_window setLevel:NSFloatingWindowLevel];
|
||||
|
||||
[debug_window orderFront:nil];
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
|
||||
GdkWindow *window)
|
||||
@@ -824,6 +927,7 @@ _gdk_windowing_window_init (void)
|
||||
{
|
||||
GdkWindowObject *private;
|
||||
GdkWindowImplQuartz *impl;
|
||||
GdkDrawableImplQuartz *drawable_impl;
|
||||
NSRect rect;
|
||||
|
||||
g_assert (_gdk_root == NULL);
|
||||
@@ -841,6 +945,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 +961,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 +989,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 +1055,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 +1087,9 @@ show_window_internal (GdkWindow *window,
|
||||
if (impl->transient_for && !GDK_WINDOW_DESTROYED (impl->transient_for))
|
||||
_gdk_quartz_window_attach_to_parent (window);
|
||||
|
||||
if (impl->toplevel)
|
||||
_gdk_quartz_events_trigger_crossing_events ();
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
}
|
||||
|
||||
@@ -1016,6 +1113,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 +1135,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 +1164,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 +1187,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 +1195,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 +1236,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 +1290,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 +2302,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 +2611,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 +2810,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 +2827,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 +2865,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 +2975,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;
|
||||
|
||||
+147
-65
@@ -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
|
||||
*/
|
||||
@@ -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,44 @@ 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)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
|
||||
}
|
||||
|
||||
impl->changing_state = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
show_window_internal (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. */
|
||||
show_window_recurse (tmp_window, hide_window);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_is_ancestor (GdkWindow *ancestor,
|
||||
GdkWindow *window)
|
||||
@@ -1725,6 +1768,13 @@ 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);
|
||||
gboolean modally_blocked = modal_current != NULL ? gdk_window_get_toplevel (window) != modal_current : FALSE;
|
||||
|
||||
if (modally_blocked == TRUE)
|
||||
return TRUE;
|
||||
|
||||
return (((msg->message == WM_KEYUP || msg->message == WM_SYSKEYUP) &&
|
||||
!(mask & GDK_KEY_RELEASE_MASK)) ||
|
||||
((msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN) &&
|
||||
@@ -2763,12 +2813,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 +2937,18 @@ gdk_event_translate (MSG *msg,
|
||||
return_val = TRUE;
|
||||
break;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
|
||||
switch (msg->wParam)
|
||||
{
|
||||
case SC_MINIMIZE:
|
||||
case SC_RESTORE:
|
||||
show_window_internal (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print (" %s %dx%d",
|
||||
@@ -2895,6 +2972,7 @@ gdk_event_translate (MSG *msg,
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_WITHDRAWN,
|
||||
GDK_WINDOW_STATE_ICONIFIED);
|
||||
show_window_internal (window, TRUE);
|
||||
}
|
||||
else if ((msg->wParam == SIZE_RESTORED ||
|
||||
msg->wParam == SIZE_MAXIMIZED) &&
|
||||
@@ -2907,16 +2985,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))
|
||||
{
|
||||
show_window_internal (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;
|
||||
@@ -3172,6 +3259,7 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*ret_valp = TRUE;
|
||||
return_val = TRUE;
|
||||
GDK_NOTE (EVENTS, g_print (" (handled ASPECT: %s)",
|
||||
@@ -3305,7 +3393,10 @@ gdk_event_translate (MSG *msg,
|
||||
append_event (event);
|
||||
}
|
||||
else
|
||||
return_val = TRUE;
|
||||
{
|
||||
return_val = TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_RENDERFORMAT:
|
||||
@@ -3340,7 +3431,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 +3447,7 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The requestor is holding the clipboard, no
|
||||
* OpenClipboard() is required/possible
|
||||
*/
|
||||
@@ -3363,47 +3457,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 +3479,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 +3506,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 +3569,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 +3615,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 +3629,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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+108
-11
@@ -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)
|
||||
@@ -1775,7 +1788,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 +1798,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 +1818,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 +2008,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 +2018,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 +2035,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)
|
||||
@@ -3313,9 +3388,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 +3404,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 +3430,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);
|
||||
@@ -3451,13 +3541,20 @@ gdk_window_set_modal_hint (GdkWindow *window,
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
+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;
|
||||
|
||||
+16
-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,6 +53,7 @@ rm $DEVZIP
|
||||
zip -r $DEVZIP -@ <<EOF
|
||||
include/gtk-2.0
|
||||
bin/gdk-pixbuf-csource.exe
|
||||
bin/gtk-builder-convert
|
||||
bin/gtk-demo.exe
|
||||
man/man1/gdk-pixbuf-csource.1
|
||||
lib/libgdk_pixbuf-@GTK_API_VERSION@.dll.a
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+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'] = child
|
||||
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,
|
||||
|
||||
+8
-3
@@ -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);
|
||||
|
||||
+6
-3
@@ -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
|
||||
|
||||
+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,
|
||||
|
||||
+2
-2
@@ -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)])
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+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);
|
||||
|
||||
+10
-2
@@ -2309,8 +2309,14 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
child.x += shadow_width;
|
||||
child.y += shadow_height;
|
||||
child.width -= shadow_width * 2;
|
||||
child.height -= shadow_height * 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 +3852,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 +5335,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));
|
||||
|
||||
+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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+11
-11
@@ -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
|
||||
*/
|
||||
|
||||
+85
-96
@@ -73,6 +73,7 @@
|
||||
#if defined (G_OS_UNIX)
|
||||
#include "gtkfilesystemunix.h"
|
||||
#elif defined (G_OS_WIN32)
|
||||
#include <windows.h>
|
||||
#include "gtkfilesystemwin32.h"
|
||||
#endif
|
||||
|
||||
@@ -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,
|
||||
@@ -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));
|
||||
@@ -2002,9 +1993,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 +2005,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 +2236,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 +3649,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
|
||||
@@ -3930,7 +3936,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 +3944,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 +4079,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))
|
||||
@@ -6857,8 +6861,12 @@ update_chooser_entry (GtkFileChooserDefault *impl)
|
||||
change_entry = TRUE; /* ... unless we are in one of the folder modes */
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -8193,23 +8201,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 +8595,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 +9839,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
|
||||
@@ -10327,8 +10299,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);
|
||||
}
|
||||
|
||||
@@ -10411,10 +10381,7 @@ shortcuts_activate_get_info_cb (GtkFileSystemHandle *handle,
|
||||
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,
|
||||
@@ -10482,25 +10449,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 +10974,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 +11097,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 +11269,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");
|
||||
}
|
||||
|
||||
+120
-1
@@ -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
|
||||
@@ -696,6 +718,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 +896,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 +1022,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 +1167,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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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')
|
||||
{
|
||||
|
||||
+54
-11
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+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
-14
@@ -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);
|
||||
|
||||
@@ -2748,7 +2752,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 +2767,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 +4316,7 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
|
||||
GtkNotebookPage *page;
|
||||
GList * next_list;
|
||||
gint need_resize = FALSE;
|
||||
GtkWidget *tab_label;
|
||||
|
||||
gboolean destroying;
|
||||
|
||||
@@ -4345,8 +4351,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 +4394,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 +6964,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 +7098,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,
|
||||
|
||||
+12
-1
@@ -478,6 +478,9 @@ gtk_paned_class_init (GtkPanedClass *class)
|
||||
gtk_binding_entry_add_signal (binding_set,
|
||||
GDK_Return, 0,
|
||||
"accept_position", 0);
|
||||
gtk_binding_entry_add_signal (binding_set,
|
||||
GDK_ISO_Enter, 0,
|
||||
"accept_position", 0);
|
||||
gtk_binding_entry_add_signal (binding_set,
|
||||
GDK_KP_Enter, 0,
|
||||
"accept_position", 0);
|
||||
@@ -1232,6 +1235,14 @@ gtk_paned_set_position (GtkPaned *paned,
|
||||
g_object_thaw_notify (object);
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (paned));
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
/* Hacky work-around for bug #144269 */
|
||||
if (paned->child2 != NULL)
|
||||
{
|
||||
gtk_widget_queue_draw (paned->child2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1595,7 +1606,7 @@ get_child_panes (GtkWidget *widget,
|
||||
}
|
||||
else if (GTK_IS_CONTAINER (widget))
|
||||
{
|
||||
gtk_container_foreach (GTK_CONTAINER (widget),
|
||||
gtk_container_forall (GTK_CONTAINER (widget),
|
||||
(GtkCallback)get_child_panes, panes);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -525,7 +525,7 @@ gtk_paper_size_get_display_name (GtkPaperSize *size)
|
||||
g_assert (size->info != NULL);
|
||||
|
||||
display_name = paper_names + size->info->display_name;
|
||||
return g_strip_context (display_name, gettext (display_name));
|
||||
return g_strip_context (display_name, _(display_name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+113
-15
@@ -80,9 +80,12 @@ G_DEFINE_TYPE (GtkPathBar, gtk_path_bar, GTK_TYPE_CONTAINER)
|
||||
|
||||
static void gtk_path_bar_finalize (GObject *object);
|
||||
static void gtk_path_bar_dispose (GObject *object);
|
||||
static void gtk_path_bar_realize (GtkWidget *widget);
|
||||
static void gtk_path_bar_unrealize (GtkWidget *widget);
|
||||
static void gtk_path_bar_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_path_bar_unmap (GtkWidget *widget);
|
||||
static void gtk_path_bar_map (GtkWidget *widget);
|
||||
static void gtk_path_bar_unmap (GtkWidget *widget);
|
||||
static void gtk_path_bar_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static void gtk_path_bar_add (GtkContainer *container,
|
||||
@@ -93,10 +96,10 @@ static void gtk_path_bar_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static void gtk_path_bar_scroll_up (GtkWidget *button,
|
||||
GtkPathBar *path_bar);
|
||||
static void gtk_path_bar_scroll_down (GtkWidget *button,
|
||||
GtkPathBar *path_bar);
|
||||
static gboolean gtk_path_bar_scroll (GtkWidget *widget,
|
||||
GdkEventScroll *event);
|
||||
static void gtk_path_bar_scroll_up (GtkPathBar *path_bar);
|
||||
static void gtk_path_bar_scroll_down (GtkPathBar *path_bar);
|
||||
static void gtk_path_bar_stop_scrolling (GtkPathBar *path_bar);
|
||||
static gboolean gtk_path_bar_slider_up_defocus (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
@@ -175,8 +178,8 @@ gtk_path_bar_init (GtkPathBar *path_bar)
|
||||
path_bar->down_slider_button = get_slider_button (path_bar, GTK_ARROW_RIGHT);
|
||||
path_bar->icon_size = FALLBACK_ICON_SIZE;
|
||||
|
||||
g_signal_connect (path_bar->up_slider_button, "clicked", G_CALLBACK (gtk_path_bar_scroll_up), path_bar);
|
||||
g_signal_connect (path_bar->down_slider_button, "clicked", G_CALLBACK (gtk_path_bar_scroll_down), path_bar);
|
||||
g_signal_connect_swapped (path_bar->up_slider_button, "clicked", G_CALLBACK (gtk_path_bar_scroll_up), path_bar);
|
||||
g_signal_connect_swapped (path_bar->down_slider_button, "clicked", G_CALLBACK (gtk_path_bar_scroll_down), path_bar);
|
||||
|
||||
g_signal_connect (path_bar->up_slider_button, "focus_out_event", G_CALLBACK (gtk_path_bar_slider_up_defocus), path_bar);
|
||||
g_signal_connect (path_bar->down_slider_button, "focus_out_event", G_CALLBACK (gtk_path_bar_slider_down_defocus), path_bar);
|
||||
@@ -204,12 +207,16 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
|
||||
gobject_class->dispose = gtk_path_bar_dispose;
|
||||
|
||||
widget_class->size_request = gtk_path_bar_size_request;
|
||||
widget_class->realize = gtk_path_bar_realize;
|
||||
widget_class->unrealize = gtk_path_bar_unrealize;
|
||||
widget_class->map = gtk_path_bar_map;
|
||||
widget_class->unmap = gtk_path_bar_unmap;
|
||||
widget_class->size_allocate = gtk_path_bar_size_allocate;
|
||||
widget_class->style_set = gtk_path_bar_style_set;
|
||||
widget_class->screen_changed = gtk_path_bar_screen_changed;
|
||||
widget_class->grab_notify = gtk_path_bar_grab_notify;
|
||||
widget_class->state_changed = gtk_path_bar_state_changed;
|
||||
widget_class->scroll_event = gtk_path_bar_scroll;
|
||||
|
||||
container_class->add = gtk_path_bar_add;
|
||||
container_class->forall = gtk_path_bar_forall;
|
||||
@@ -362,14 +369,67 @@ gtk_path_bar_update_slider_buttons (GtkPathBar *path_bar)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_bar_map (GtkWidget *widget)
|
||||
{
|
||||
gdk_window_show (GTK_PATH_BAR (widget)->event_window);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->map (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_bar_unmap (GtkWidget *widget)
|
||||
{
|
||||
gtk_path_bar_stop_scrolling (GTK_PATH_BAR (widget));
|
||||
gdk_window_hide (GTK_PATH_BAR (widget)->event_window);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->unmap (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_bar_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkPathBar *path_bar;
|
||||
GdkWindowAttr attributes;
|
||||
gint attributes_mask;
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
||||
|
||||
path_bar = GTK_PATH_BAR (widget);
|
||||
widget->window = gtk_widget_get_parent_window (widget);
|
||||
g_object_ref (widget->window);
|
||||
|
||||
attributes.window_type = GDK_WINDOW_CHILD;
|
||||
attributes.x = widget->allocation.x;
|
||||
attributes.y = widget->allocation.y;
|
||||
attributes.width = widget->allocation.width;
|
||||
attributes.height = widget->allocation.height;
|
||||
attributes.wclass = GDK_INPUT_ONLY;
|
||||
attributes.event_mask = gtk_widget_get_events (widget);
|
||||
attributes.event_mask |= GDK_SCROLL_MASK;
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y;
|
||||
|
||||
path_bar->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
||||
&attributes, attributes_mask);
|
||||
gdk_window_set_user_data (path_bar->event_window, widget);
|
||||
|
||||
widget->style = gtk_style_attach (widget->style, widget->window);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_bar_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkPathBar *path_bar;
|
||||
|
||||
path_bar = GTK_PATH_BAR (widget);
|
||||
|
||||
gdk_window_set_user_data (path_bar->event_window, NULL);
|
||||
gdk_window_destroy (path_bar->event_window);
|
||||
path_bar->event_window = NULL;
|
||||
|
||||
(* GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->unrealize) (widget);
|
||||
}
|
||||
|
||||
/* This is a tad complicated
|
||||
*/
|
||||
static void
|
||||
@@ -390,6 +450,11 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
|
||||
|
||||
widget->allocation = *allocation;
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
gdk_window_move_resize (path_bar->event_window,
|
||||
allocation->x, allocation->y,
|
||||
allocation->width, allocation->height);
|
||||
|
||||
/* No path is set; we don't have to allocate anything. */
|
||||
if (path_bar->button_list == NULL)
|
||||
return;
|
||||
@@ -594,6 +659,25 @@ gtk_path_bar_screen_changed (GtkWidget *widget,
|
||||
gtk_path_bar_check_icon_theme (GTK_PATH_BAR (widget));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_path_bar_scroll (GtkWidget *widget,
|
||||
GdkEventScroll *event)
|
||||
{
|
||||
switch (event->direction)
|
||||
{
|
||||
case GDK_SCROLL_RIGHT:
|
||||
case GDK_SCROLL_DOWN:
|
||||
gtk_path_bar_scroll_down (GTK_PATH_BAR (widget));
|
||||
break;
|
||||
case GDK_SCROLL_LEFT:
|
||||
case GDK_SCROLL_UP:
|
||||
gtk_path_bar_scroll_up (GTK_PATH_BAR (widget));
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_bar_add (GtkContainer *container,
|
||||
GtkWidget *widget)
|
||||
@@ -679,7 +763,7 @@ gtk_path_bar_forall (GtkContainer *container,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_bar_scroll_down (GtkWidget *button, GtkPathBar *path_bar)
|
||||
gtk_path_bar_scroll_down (GtkPathBar *path_bar)
|
||||
{
|
||||
GList *list;
|
||||
GList *down_button = NULL;
|
||||
@@ -695,11 +779,17 @@ gtk_path_bar_scroll_down (GtkWidget *button, GtkPathBar *path_bar)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gtk_widget_get_child_visible (BUTTON_DATA (path_bar->button_list->data)->button))
|
||||
{
|
||||
/* Return if the last button is already visible */
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (path_bar));
|
||||
|
||||
border_width = GTK_CONTAINER (path_bar)->border_width;
|
||||
direction = gtk_widget_get_direction (GTK_WIDGET (path_bar));
|
||||
|
||||
|
||||
/* We find the button at the 'down' end that we have to make
|
||||
* visible */
|
||||
for (list = path_bar->button_list; list; list = list->next)
|
||||
@@ -745,7 +835,7 @@ gtk_path_bar_scroll_down (GtkWidget *button, GtkPathBar *path_bar)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_path_bar_scroll_up (GtkWidget *button, GtkPathBar *path_bar)
|
||||
gtk_path_bar_scroll_up (GtkPathBar *path_bar)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
@@ -755,9 +845,17 @@ gtk_path_bar_scroll_up (GtkWidget *button, GtkPathBar *path_bar)
|
||||
return;
|
||||
}
|
||||
|
||||
list = g_list_last (path_bar->button_list);
|
||||
|
||||
if (gtk_widget_get_child_visible (BUTTON_DATA (list->data)->button))
|
||||
{
|
||||
/* Return if the first button is already visible */
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (path_bar));
|
||||
|
||||
for (list = g_list_last (path_bar->button_list); list; list = list->prev)
|
||||
for ( ; list; list = list->prev)
|
||||
{
|
||||
if (list->prev && gtk_widget_get_child_visible (BUTTON_DATA (list->prev->data)->button))
|
||||
{
|
||||
@@ -777,9 +875,9 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
|
||||
if (path_bar->timer)
|
||||
{
|
||||
if (path_bar->scrolling_up)
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
gtk_path_bar_scroll_up (path_bar);
|
||||
else if (path_bar->scrolling_down)
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
gtk_path_bar_scroll_down (path_bar);
|
||||
|
||||
if (path_bar->need_timer)
|
||||
{
|
||||
@@ -882,13 +980,13 @@ gtk_path_bar_slider_button_press (GtkWidget *widget,
|
||||
{
|
||||
path_bar->scrolling_down = FALSE;
|
||||
path_bar->scrolling_up = TRUE;
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
gtk_path_bar_scroll_up (path_bar);
|
||||
}
|
||||
else if (widget == path_bar->down_slider_button)
|
||||
{
|
||||
path_bar->scrolling_up = FALSE;
|
||||
path_bar->scrolling_down = TRUE;
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
gtk_path_bar_scroll_down (path_bar);
|
||||
}
|
||||
|
||||
if (!path_bar->timer)
|
||||
|
||||
@@ -51,6 +51,8 @@ struct _GtkPathBar
|
||||
GdkPixbuf *home_icon;
|
||||
GdkPixbuf *desktop_icon;
|
||||
|
||||
GdkWindow *event_window;
|
||||
|
||||
GList *button_list;
|
||||
GList *first_scrolled_button;
|
||||
GList *fake_root;
|
||||
|
||||
@@ -36,7 +36,7 @@ void _gtk_plug_handle_modality_off (GtkPlug *plug);
|
||||
|
||||
/* In backend-specific file: */
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_get_id:
|
||||
*
|
||||
* @plug: a #GtkPlug
|
||||
@@ -45,7 +45,7 @@ void _gtk_plug_handle_modality_off (GtkPlug *plug);
|
||||
*/
|
||||
GdkNativeWindow _gtk_plug_windowing_get_id (GtkPlug *plug);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_realize_toplevel:
|
||||
*
|
||||
* @plug_window: a #GtkPlug's #GdkWindow
|
||||
@@ -55,7 +55,7 @@ GdkNativeWindow _gtk_plug_windowing_get_id (GtkPlug *plug);
|
||||
*/
|
||||
void _gtk_plug_windowing_realize_toplevel (GtkPlug *plug);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_map_toplevel:
|
||||
*
|
||||
* @plug: a #GtkPlug
|
||||
@@ -65,7 +65,7 @@ void _gtk_plug_windowing_realize_toplevel (GtkPlug *plug);
|
||||
*/
|
||||
void _gtk_plug_windowing_map_toplevel (GtkPlug *plug);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_map_toplevel:
|
||||
*
|
||||
* @plug: a #GtkPlug
|
||||
@@ -75,7 +75,7 @@ void _gtk_plug_windowing_map_toplevel (GtkPlug *plug);
|
||||
*/
|
||||
void _gtk_plug_windowing_unmap_toplevel (GtkPlug *plug);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_set_focus:
|
||||
*
|
||||
* @plug: a #GtkPlug
|
||||
@@ -85,7 +85,7 @@ void _gtk_plug_windowing_unmap_toplevel (GtkPlug *plug);
|
||||
*/
|
||||
void _gtk_plug_windowing_set_focus (GtkPlug *plug);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_add_grabbed_key:
|
||||
*
|
||||
* @plug: a #GtkPlug
|
||||
@@ -99,7 +99,7 @@ void _gtk_plug_windowing_add_grabbed_key (GtkPlug *plug,
|
||||
guint accelerator_key,
|
||||
GdkModifierType accelerator_mods);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_remove_grabbed_key:
|
||||
*
|
||||
* @plug: a #GtkPlug
|
||||
@@ -113,7 +113,7 @@ void _gtk_plug_windowing_remove_grabbed_key (GtkPlug *plug,
|
||||
guint accelerator_key,
|
||||
GdkModifierType accelerator_mods);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_focus_to_parent:
|
||||
*
|
||||
* @plug: a #GtkPlug
|
||||
@@ -125,7 +125,7 @@ void _gtk_plug_windowing_remove_grabbed_key (GtkPlug *plug,
|
||||
void _gtk_plug_windowing_focus_to_parent (GtkPlug *plug,
|
||||
GtkDirectionType direction);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_plug_windowing_filter_func:
|
||||
*
|
||||
* @gdk_xevent: a windowing system native event
|
||||
|
||||
@@ -1517,8 +1517,7 @@ _gtk_print_operation_set_status (GtkPrintOperation *op,
|
||||
status = GTK_PRINT_STATUS_FINISHED_ABORTED;
|
||||
|
||||
if (string == NULL)
|
||||
string = g_strip_context (status_strs[status],
|
||||
gettext (status_strs[status]));
|
||||
string = g_strip_context (status_strs[status], _(status_strs[status]));
|
||||
|
||||
if (priv->status == status &&
|
||||
strcmp (string, priv->status_string) == 0)
|
||||
|
||||
@@ -1283,8 +1283,6 @@ gtk_print_settings_get_page_ranges (GtkPrintSettings *settings,
|
||||
{
|
||||
str++;
|
||||
end = (gint)strtol (str, NULL, 10);
|
||||
if (end < start)
|
||||
end = start;
|
||||
}
|
||||
|
||||
ranges[i].start = start;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* GtkPrintUnixDialog
|
||||
* Copyright (C) 2006 John (J5) Palmieri <johnp@redhat.com>
|
||||
* Copyright (C) 2006 Alexander Larsson <alexl@redhat.com>
|
||||
* Copyright © 2006, 2007 Christian Persch
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -589,7 +590,7 @@ gtk_print_unix_dialog_get_property (GObject *object,
|
||||
g_value_set_int (value, priv->current_page);
|
||||
break;
|
||||
case PROP_PRINT_SETTINGS:
|
||||
g_value_set_object (value, gtk_print_unix_dialog_get_settings (dialog));
|
||||
g_value_take_object (value, gtk_print_unix_dialog_get_settings (dialog));
|
||||
break;
|
||||
case PROP_SELECTED_PRINTER:
|
||||
g_value_set_object (value, priv->current_printer);
|
||||
@@ -733,7 +734,7 @@ wrap_in_frame (const gchar *label,
|
||||
GtkWidget *frame, *alignment, *label_widget;
|
||||
gchar *bold_text;
|
||||
|
||||
label_widget = gtk_label_new ("");
|
||||
label_widget = gtk_label_new (NULL);
|
||||
gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
|
||||
gtk_widget_show (label_widget);
|
||||
|
||||
@@ -1728,7 +1729,7 @@ dialog_set_page_ranges (GtkPrintUnixDialog *dialog,
|
||||
{
|
||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||
gint i;
|
||||
GString *s = g_string_new ("");
|
||||
GString *s = g_string_new (NULL);
|
||||
|
||||
for (i = 0; i < n_ranges; i++)
|
||||
{
|
||||
@@ -1994,7 +1995,8 @@ draw_page_cb (GtkWidget *widget,
|
||||
cairo_restore (cr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
g_object_unref (layout);
|
||||
cairo_destroy (cr);
|
||||
|
||||
return TRUE;
|
||||
|
||||
+10
-8
@@ -220,7 +220,7 @@ _gtk_quartz_get_selection_data_from_pasteboard (NSPasteboard *pasteboard,
|
||||
NSURL *url = [NSURL URLFromPasteboard:pasteboard];
|
||||
|
||||
selection_data->target = gdk_atom_intern_static_string ("text/uri-list");
|
||||
|
||||
|
||||
uris[0] = (gchar *) [[url description] UTF8String];
|
||||
uris[1] = NULL;
|
||||
gtk_selection_data_set_uris (selection_data, uris);
|
||||
@@ -295,14 +295,16 @@ _gtk_quartz_set_selection_data_for_pasteboard (NSPasteboard *pasteboard,
|
||||
&list);
|
||||
|
||||
if (count > 0)
|
||||
result = g_uri_list_extract_uris (list[0]);
|
||||
{
|
||||
result = g_uri_list_extract_uris (list[0]);
|
||||
|
||||
url = [NSURL URLWithString:[NSString stringWithUTF8String:result[0]]];
|
||||
[url writeToPasteboard:pasteboard];
|
||||
|
||||
g_strfreev (result);
|
||||
}
|
||||
|
||||
g_strfreev (list);
|
||||
|
||||
url = [NSURL URLWithString:[NSString stringWithUTF8String:result[0]]];
|
||||
[url writeToPasteboard:pasteboard];
|
||||
|
||||
g_strfreev (result);
|
||||
|
||||
}
|
||||
else
|
||||
[pasteboard setData:[NSData dataWithBytesNoCopy:selection_data->data
|
||||
|
||||
@@ -350,6 +350,7 @@ gtk_recent_action_connect_proxy (GtkAction *action,
|
||||
"limit", priv->limit,
|
||||
"sort-type", priv->sort_type,
|
||||
"filter", priv->current_filter,
|
||||
"local-only", priv->local_only,
|
||||
NULL);
|
||||
|
||||
if (priv->sort_func)
|
||||
@@ -404,6 +405,7 @@ gtk_recent_action_create_menu (GtkAction *action)
|
||||
"sort-type", priv->sort_type,
|
||||
"recent-manager", priv->manager,
|
||||
"filter", priv->current_filter,
|
||||
"local-only", priv->local_only,
|
||||
NULL);
|
||||
|
||||
if (priv->sort_func)
|
||||
|
||||
@@ -177,7 +177,7 @@ gtk_recent_chooser_class_init (gpointer g_iface)
|
||||
g_param_spec_boolean ("show-not-found",
|
||||
P_("Show Not Found"),
|
||||
P_("Whether the items pointing to unavailable resources should be displayed"),
|
||||
FALSE,
|
||||
TRUE,
|
||||
GTK_PARAM_READWRITE));
|
||||
/**
|
||||
* GtkRecentChooser:select-multiple:
|
||||
|
||||
@@ -345,7 +345,7 @@ _gtk_recent_chooser_default_init (GtkRecentChooserDefault *impl)
|
||||
impl->show_icons = TRUE;
|
||||
impl->show_private = FALSE;
|
||||
impl->show_not_found = TRUE;
|
||||
impl->show_tips = TRUE;
|
||||
impl->show_tips = FALSE;
|
||||
impl->select_multiple = FALSE;
|
||||
impl->local_only = TRUE;
|
||||
|
||||
|
||||
@@ -324,6 +324,7 @@ gtk_recent_chooser_menu_constructor (GType type,
|
||||
GINT_TO_POINTER (TRUE));
|
||||
|
||||
gtk_menu_shell_insert (GTK_MENU_SHELL (menu), priv->placeholder, 0);
|
||||
gtk_widget_set_no_show_all (priv->placeholder, TRUE);
|
||||
gtk_widget_show (priv->placeholder);
|
||||
|
||||
/* (re)populate the menu */
|
||||
@@ -926,8 +927,6 @@ idle_populate_func (gpointer data)
|
||||
pdata = (MenuPopulateData *) data;
|
||||
priv = pdata->menu->priv;
|
||||
|
||||
priv->populate_id = 0;
|
||||
|
||||
if (!pdata->items)
|
||||
{
|
||||
pdata->items = gtk_recent_chooser_get_items (GTK_RECENT_CHOOSER (pdata->menu));
|
||||
@@ -936,6 +935,7 @@ idle_populate_func (gpointer data)
|
||||
/* show the placeholder here */
|
||||
gtk_widget_show (pdata->placeholder);
|
||||
pdata->displayed_items = 1;
|
||||
priv->populate_id = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -977,6 +977,7 @@ check_and_return:
|
||||
{
|
||||
g_list_foreach (pdata->items, (GFunc) gtk_recent_info_unref, NULL);
|
||||
g_list_free (pdata->items);
|
||||
priv->populate_id = 0;
|
||||
|
||||
retval = FALSE;
|
||||
}
|
||||
@@ -991,14 +992,18 @@ idle_populate_clean_up (gpointer data)
|
||||
{
|
||||
MenuPopulateData *pdata = data;
|
||||
|
||||
/* show the placeholder in case no item survived
|
||||
* the filtering process in the idle loop
|
||||
*/
|
||||
if (!pdata->displayed_items)
|
||||
gtk_widget_show (pdata->placeholder);
|
||||
g_object_unref (pdata->placeholder);
|
||||
if (pdata->menu->priv->populate_id == 0)
|
||||
{
|
||||
/* show the placeholder in case no item survived
|
||||
* the filtering process in the idle loop
|
||||
*/
|
||||
if (!pdata->displayed_items)
|
||||
gtk_widget_show (pdata->placeholder);
|
||||
|
||||
g_slice_free (MenuPopulateData, data);
|
||||
g_object_unref (pdata->placeholder);
|
||||
|
||||
g_slice_free (MenuPopulateData, data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -302,7 +302,7 @@ sort_recent_items_mru (GtkRecentInfo *a,
|
||||
{
|
||||
g_assert (a != NULL && b != NULL);
|
||||
|
||||
return (gtk_recent_info_get_modified (a) < gtk_recent_info_get_modified (b));
|
||||
return (gtk_recent_info_get_modified (b) - gtk_recent_info_get_modified (a));
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -312,7 +312,7 @@ sort_recent_items_lru (GtkRecentInfo *a,
|
||||
{
|
||||
g_assert (a != NULL && b != NULL);
|
||||
|
||||
return (gtk_recent_info_get_modified (a) > gtk_recent_info_get_modified (b));
|
||||
return -1 * (gtk_recent_info_get_modified (b) > gtk_recent_info_get_modified (a));
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -297,6 +297,8 @@ gtk_scale_button_class_init (GtkScaleButtonClass *klass)
|
||||
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
|
||||
"popup", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
|
||||
"popup", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_Return, 0,
|
||||
"popup", 0);
|
||||
gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0,
|
||||
|
||||
@@ -69,8 +69,6 @@ static GSList *(*beagle_hits_subtracted_response_get_uris) (BeagleHitsSubtracted
|
||||
static BeagleQuery *(*beagle_query_new) (void) = NULL;
|
||||
static void (*beagle_query_add_text) (BeagleQuery *query,
|
||||
const char *str) = NULL;
|
||||
static void (*beagle_query_add_hit_type) (BeagleQuery *query,
|
||||
const char *hit_type) = NULL;
|
||||
static void (*beagle_query_set_max_hits) (BeagleQuery *query,
|
||||
gint max_hits) = NULL;
|
||||
static BeagleQueryPartProperty *(*beagle_query_part_property_new) (void) = NULL;
|
||||
@@ -102,7 +100,6 @@ static struct BeagleDlMapping
|
||||
MAP (beagle_hits_subtracted_response_get_uris),
|
||||
MAP (beagle_query_new),
|
||||
MAP (beagle_query_add_text),
|
||||
MAP (beagle_query_add_hit_type),
|
||||
MAP (beagle_query_set_max_hits),
|
||||
MAP (beagle_query_part_property_new),
|
||||
MAP (beagle_query_part_set_logic),
|
||||
@@ -129,7 +126,10 @@ open_libbeagle (void)
|
||||
|
||||
done = TRUE;
|
||||
|
||||
beagle = g_module_open ("libbeagle.so.0", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
|
||||
beagle = g_module_open ("libbeagle.so.1", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
|
||||
if (!beagle)
|
||||
beagle = g_module_open ("libbeagle.so.0", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
|
||||
|
||||
if (!beagle)
|
||||
return;
|
||||
|
||||
@@ -274,6 +274,7 @@ gtk_search_engine_beagle_start (GtkSearchEngine *engine)
|
||||
GtkSearchEngineBeagle *beagle;
|
||||
GError *error;
|
||||
gchar *text;
|
||||
gchar *query;
|
||||
|
||||
error = NULL;
|
||||
beagle = GTK_SEARCH_ENGINE_BEAGLE (engine);
|
||||
@@ -295,11 +296,13 @@ gtk_search_engine_beagle_start (GtkSearchEngine *engine)
|
||||
"error", G_CALLBACK (beagle_error), engine);
|
||||
|
||||
/* We only want files */
|
||||
beagle_query_add_hit_type (beagle->priv->current_query, "File");
|
||||
beagle_query_set_max_hits (beagle->priv->current_query, 1000);
|
||||
|
||||
|
||||
text = _gtk_query_get_text (beagle->priv->query);
|
||||
beagle_query_add_text (beagle->priv->current_query, text);
|
||||
query = g_strconcat (text, " type:File", NULL);
|
||||
|
||||
beagle_query_set_max_hits (beagle->priv->current_query, 1000);
|
||||
beagle_query_add_text (beagle->priv->current_query, query);
|
||||
|
||||
beagle->priv->current_query_uri_prefix = _gtk_query_get_location (beagle->priv->query);
|
||||
|
||||
@@ -312,6 +315,7 @@ gtk_search_engine_beagle_start (GtkSearchEngine *engine)
|
||||
|
||||
/* These must live during the lifetime of the query */
|
||||
g_free (text);
|
||||
g_free (query);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+4
-4
@@ -48,13 +48,13 @@ G_BEGIN_DECLS
|
||||
#define gtk_signal_emit_stop(object,signal_id) \
|
||||
g_signal_stop_emission ((object), (signal_id), 0)
|
||||
#define gtk_signal_connect(object,name,func,func_data) \
|
||||
gtk_signal_connect_full ((object), (name), (func), 0, (func_data), 0, 0, 0)
|
||||
gtk_signal_connect_full ((object), (name), (func), NULL, (func_data), NULL, 0, 0)
|
||||
#define gtk_signal_connect_after(object,name,func,func_data) \
|
||||
gtk_signal_connect_full ((object), (name), (func), 0, (func_data), 0, 0, 1)
|
||||
gtk_signal_connect_full ((object), (name), (func), NULL, (func_data), NULL, 0, 1)
|
||||
#define gtk_signal_connect_object(object,name,func,slot_object) \
|
||||
gtk_signal_connect_full ((object), (name), (func), 0, (slot_object), 0, 1, 0)
|
||||
gtk_signal_connect_full ((object), (name), (func), NULL, (slot_object), NULL, 1, 0)
|
||||
#define gtk_signal_connect_object_after(object,name,func,slot_object) \
|
||||
gtk_signal_connect_full ((object), (name), (func), 0, (slot_object), 0, 1, 1)
|
||||
gtk_signal_connect_full ((object), (name), (func), NULL, (slot_object), NULL, 1, 1)
|
||||
#define gtk_signal_disconnect(object,handler_id) \
|
||||
g_signal_handler_disconnect ((object), (handler_id))
|
||||
#define gtk_signal_handler_block(object,handler_id) \
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ enum {
|
||||
|
||||
static guint socket_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_get_private:
|
||||
*
|
||||
* @socket: a #GtkSocket
|
||||
|
||||
+16
-16
@@ -56,7 +56,7 @@ void _gtk_socket_advance_toplevel_focus (GtkSocket *socket,
|
||||
|
||||
/* In backend-specific file: */
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_get_id:
|
||||
*
|
||||
* @socket: a #GtkSocket
|
||||
@@ -65,25 +65,25 @@ void _gtk_socket_advance_toplevel_focus (GtkSocket *socket,
|
||||
*/
|
||||
GdkNativeWindow _gtk_socket_windowing_get_id (GtkSocket *socket);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_realize_window:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_realize_window (GtkSocket *socket);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_end_embedding_toplevel:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_end_embedding_toplevel (GtkSocket *socket);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_size_request:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_size_request (GtkSocket *socket);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_send_key_event:
|
||||
*
|
||||
*/
|
||||
@@ -91,41 +91,41 @@ void _gtk_socket_windowing_send_key_event (GtkSocket *socket,
|
||||
GdkEvent *gdk_event,
|
||||
gboolean mask_key_presses);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_focus_change:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_focus_change (GtkSocket *socket,
|
||||
gboolean focus_in);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_update_active:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_update_active (GtkSocket *socket,
|
||||
gboolean active);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_update_modality:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_update_modality (GtkSocket *socket,
|
||||
gboolean modality);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_focus:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_focus (GtkSocket *socket,
|
||||
GtkDirectionType direction);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_send_configure_event:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_send_configure_event (GtkSocket *socket);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_select_plug_window_input:
|
||||
*
|
||||
* Asks the windowing system to send necessary events related to the
|
||||
@@ -134,7 +134,7 @@ void _gtk_socket_windowing_send_configure_event (GtkSocket *socket);
|
||||
*/
|
||||
void _gtk_socket_windowing_select_plug_window_input (GtkSocket *socket);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_embed_get_info:
|
||||
*
|
||||
* Gets whatever information necessary about an out-of-process plug
|
||||
@@ -142,25 +142,25 @@ void _gtk_socket_windowing_select_plug_window_input (GtkSocket *socket);
|
||||
*/
|
||||
void _gtk_socket_windowing_embed_get_info (GtkSocket *socket);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_embed_notify:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_embed_notify (GtkSocket *socket);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_embed_get_focus_wrapped:
|
||||
*
|
||||
*/
|
||||
gboolean _gtk_socket_windowing_embed_get_focus_wrapped (void);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_embed_set_focus_wrapped:
|
||||
*
|
||||
*/
|
||||
void _gtk_socket_windowing_embed_set_focus_wrapped (void);
|
||||
|
||||
/**
|
||||
/*
|
||||
* _gtk_socket_windowing_filter_func:
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
#include "gtklabel.h"
|
||||
#endif
|
||||
|
||||
#include "gtkmain.h"
|
||||
#include "gdkkeysyms.h"
|
||||
|
||||
#include "gtkalias.h"
|
||||
|
||||
#define BLINK_TIMEOUT 500
|
||||
@@ -150,6 +153,9 @@ static void gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon);
|
||||
static void gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon);
|
||||
|
||||
#endif
|
||||
static gboolean gtk_status_icon_key_press (GtkStatusIcon *status_icon,
|
||||
GdkEventKey *event);
|
||||
static void gtk_status_icon_popup_menu (GtkStatusIcon *status_icon);
|
||||
static gboolean gtk_status_icon_button_press (GtkStatusIcon *status_icon,
|
||||
GdkEventButton *event);
|
||||
static void gtk_status_icon_disable_blinking (GtkStatusIcon *status_icon);
|
||||
@@ -488,6 +494,10 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
|
||||
gtk_widget_add_events (GTK_WIDGET (priv->tray_icon),
|
||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
|
||||
g_signal_connect_swapped (priv->tray_icon, "key-press-event",
|
||||
G_CALLBACK (gtk_status_icon_key_press), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "popup-menu",
|
||||
G_CALLBACK (gtk_status_icon_popup_menu), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "notify::embedded",
|
||||
G_CALLBACK (gtk_status_icon_embedded_changed), status_icon);
|
||||
g_signal_connect_swapped (priv->tray_icon, "notify::orientation",
|
||||
@@ -497,6 +507,7 @@ gtk_status_icon_init (GtkStatusIcon *status_icon)
|
||||
g_signal_connect_swapped (priv->tray_icon, "screen-changed",
|
||||
G_CALLBACK (gtk_status_icon_screen_changed), status_icon);
|
||||
priv->image = gtk_image_new ();
|
||||
GTK_WIDGET_SET_FLAGS (priv->image, GTK_CAN_FOCUS);
|
||||
gtk_container_add (GTK_CONTAINER (priv->tray_icon), priv->image);
|
||||
gtk_widget_show (priv->image);
|
||||
|
||||
@@ -1200,6 +1211,34 @@ gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon)
|
||||
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
gtk_status_icon_key_press (GtkStatusIcon *status_icon,
|
||||
GdkEventKey *event)
|
||||
{
|
||||
guint state, keyval;
|
||||
|
||||
state = event->state & gtk_accelerator_get_default_mod_mask ();
|
||||
keyval = event->keyval;
|
||||
if (state == 0 &&
|
||||
(keyval == GDK_Return ||
|
||||
keyval == GDK_KP_Enter ||
|
||||
keyval == GDK_ISO_Enter ||
|
||||
keyval == GDK_space ||
|
||||
keyval == GDK_KP_Space))
|
||||
{
|
||||
emit_activate_signal (status_icon);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_status_icon_popup_menu (GtkStatusIcon *status_icon)
|
||||
{
|
||||
emit_popup_menu_signal (status_icon, 0, gtk_get_current_event_time ());
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_status_icon_button_press (GtkStatusIcon *status_icon,
|
||||
GdkEventButton *event)
|
||||
|
||||
+2
-2
@@ -714,7 +714,7 @@ gtk_table_set_row_spacings (GtkTable *table,
|
||||
* the spacing that will be used for newly added rows.
|
||||
* (See gtk_table_set_row_spacings())
|
||||
*
|
||||
* Returns value: the default row spacing
|
||||
* Return value: the default row spacing
|
||||
**/
|
||||
guint
|
||||
gtk_table_get_default_row_spacing (GtkTable *table)
|
||||
@@ -750,7 +750,7 @@ gtk_table_set_col_spacings (GtkTable *table,
|
||||
* the spacing that will be used for newly added columns.
|
||||
* (See gtk_table_set_col_spacings())
|
||||
*
|
||||
* Returns value: the default column spacing
|
||||
* Return value: the default column spacing
|
||||
**/
|
||||
guint
|
||||
gtk_table_get_default_col_spacing (GtkTable *table)
|
||||
|
||||
@@ -1909,6 +1909,7 @@ gtk_text_key_press (GtkWidget *widget,
|
||||
case GDK_KP_Down:
|
||||
case GDK_Down: scroll_int (text, +KEY_SCROLL_PIXELS); break;
|
||||
case GDK_Return:
|
||||
case GDK_ISO_Enter:
|
||||
case GDK_KP_Enter:
|
||||
if (event->state & GDK_CONTROL_MASK)
|
||||
gtk_signal_emit_by_name (GTK_OBJECT (text), "activate");
|
||||
@@ -2028,6 +2029,7 @@ gtk_text_key_press (GtkWidget *widget,
|
||||
gtk_editable_insert_text (GTK_EDITABLE (old_editable), "\t", 1, &position);
|
||||
break;
|
||||
case GDK_KP_Enter:
|
||||
case GDK_ISO_Enter:
|
||||
case GDK_Return:
|
||||
if (event->state & GDK_CONTROL_MASK)
|
||||
gtk_signal_emit_by_name (GTK_OBJECT (text), "activate");
|
||||
|
||||
@@ -1625,17 +1625,8 @@ text_span_free (TextSpan *span)
|
||||
static void
|
||||
parse_info_free (ParseInfo *info)
|
||||
{
|
||||
GSList *slist;
|
||||
GList *list;
|
||||
|
||||
slist = info->tag_stack;
|
||||
while (slist)
|
||||
{
|
||||
g_free (slist->data);
|
||||
|
||||
slist = slist->next;
|
||||
}
|
||||
|
||||
g_slist_free (info->tag_stack);
|
||||
g_slist_free (info->states);
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@
|
||||
|
||||
typedef struct _GtkTextRealIter GtkTextRealIter;
|
||||
|
||||
struct _GtkTextRealIter
|
||||
struct G_GNUC_MAY_ALIAS _GtkTextRealIter
|
||||
{
|
||||
/* Always-valid information */
|
||||
GtkTextBTree *tree;
|
||||
|
||||
@@ -4094,6 +4094,7 @@ gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
|
||||
/* use overall editability not can_insert, more predictable for users */
|
||||
else if (text_view->editable &&
|
||||
(event->keyval == GDK_Return ||
|
||||
event->keyval == GDK_ISO_Enter ||
|
||||
event->keyval == GDK_KP_Enter))
|
||||
{
|
||||
/* this won't actually insert the newline if the cursor isn't
|
||||
|
||||
+2
-2
@@ -484,7 +484,7 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
|
||||
P_("Toolbar Style"),
|
||||
P_("How to draw the toolbar"),
|
||||
GTK_TYPE_TOOLBAR_STYLE,
|
||||
GTK_TOOLBAR_ICONS,
|
||||
DEFAULT_TOOLBAR_STYLE,
|
||||
GTK_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_SHOW_ARROW,
|
||||
@@ -3877,7 +3877,7 @@ struct _ToolbarContent
|
||||
GtkAllocation goal_allocation;
|
||||
guint is_placeholder : 1;
|
||||
guint disappearing : 1;
|
||||
TriState has_menu : 2;
|
||||
guint has_menu : 2;
|
||||
} tool_item;
|
||||
|
||||
struct
|
||||
|
||||
+21
-2
@@ -92,6 +92,8 @@ static void gtk_tooltip_window_hide (GtkWidget *widget,
|
||||
static void gtk_tooltip_display_closed (GdkDisplay *display,
|
||||
gboolean was_error,
|
||||
GtkTooltip *tooltip);
|
||||
static void gtk_tooltip_set_last_window (GtkTooltip *tooltip,
|
||||
GdkWindow *window);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GtkTooltip, gtk_tooltip, G_TYPE_OBJECT);
|
||||
@@ -179,6 +181,8 @@ gtk_tooltip_finalize (GObject *object)
|
||||
tooltip->browse_mode_timeout_id = 0;
|
||||
}
|
||||
|
||||
gtk_tooltip_set_last_window (tooltip, NULL);
|
||||
|
||||
if (tooltip->window)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
@@ -707,6 +711,21 @@ gtk_tooltip_display_closed (GdkDisplay *display,
|
||||
g_object_set_data (G_OBJECT (display), "gdk-display-current-tooltip", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tooltip_set_last_window (GtkTooltip *tooltip,
|
||||
GdkWindow *window)
|
||||
{
|
||||
if (tooltip->last_window)
|
||||
g_object_remove_weak_pointer (G_OBJECT (tooltip->last_window),
|
||||
(gpointer *) &tooltip->last_window);
|
||||
|
||||
tooltip->last_window = window;
|
||||
|
||||
if (window)
|
||||
g_object_add_weak_pointer (G_OBJECT (tooltip->last_window),
|
||||
(gpointer *) &tooltip->last_window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_tooltip_run_requery (GtkWidget **widget,
|
||||
GtkTooltip *tooltip,
|
||||
@@ -1163,7 +1182,7 @@ _gtk_tooltip_handle_event (GdkEvent *event)
|
||||
|
||||
if (current_tooltip)
|
||||
{
|
||||
current_tooltip->last_window = event->any.window;
|
||||
gtk_tooltip_set_last_window (current_tooltip, event->any.window);
|
||||
gdk_event_get_root_coords (event,
|
||||
¤t_tooltip->last_x,
|
||||
¤t_tooltip->last_y);
|
||||
@@ -1271,7 +1290,7 @@ _gtk_tooltip_handle_event (GdkEvent *event)
|
||||
G_CALLBACK (gtk_tooltip_display_closed),
|
||||
current_tooltip);
|
||||
|
||||
current_tooltip->last_window = event->any.window;
|
||||
gtk_tooltip_set_last_window (current_tooltip, event->any.window);
|
||||
gdk_event_get_root_coords (event,
|
||||
¤t_tooltip->last_x,
|
||||
¤t_tooltip->last_y);
|
||||
|
||||
+19
-3
@@ -139,13 +139,29 @@ static gboolean
|
||||
gtk_tray_icon_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkWidget *focus_child;
|
||||
gint border_width, x, y, width, height;
|
||||
gboolean retval = FALSE;
|
||||
|
||||
gdk_window_clear_area (widget->window, event->area.x, event->area.y,
|
||||
event->area.width, event->area.height);
|
||||
|
||||
if (GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->expose_event)
|
||||
return GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->expose_event (widget, event);
|
||||
if (GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->expose_event)
|
||||
retval = GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->expose_event (widget, event);
|
||||
|
||||
return FALSE;
|
||||
focus_child = GTK_CONTAINER (widget)->focus_child;
|
||||
if (focus_child && GTK_WIDGET_HAS_FOCUS (focus_child))
|
||||
{
|
||||
width = widget->allocation.width;
|
||||
height = widget->allocation.height;
|
||||
|
||||
gtk_paint_focus (widget->style, widget->window,
|
||||
GTK_WIDGET_STATE (widget),
|
||||
&event->area, widget, "tray_icon",
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user